Skip to content

Commit

Permalink
Changelog and docs for 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
arokettu committed Jul 14, 2023
1 parent 7ecca82 commit b6dae4d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## 4.x

### 4.1.0

*Jul 14, 2023*

* Removed implicit conversion of floats to strings.
Since it was unreliable, it's not considered a BC break.

### 4.0.0

*Dec 14, 2022*
Expand Down
4 changes: 1 addition & 3 deletions docs/decoding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,18 @@ Scalars will be converted to their respective types.
"d" .
"3:arrli1ei2ei3ei4ee" .
"4:booli1e" .
"5:float6:3.1415" .
"3:inti123e" .
"6:string9:test\0test" .
"e"
);
// [
// "arr" => [1,2,3,4],
// "bool" => 1,
// "float" => "3.1415",
// "int" => 123,
// "string" => "test\0test",
// ]
Please note that floats and booleans will stay converted because Bencode has no native support for these types.
Please note that booleans will stay converted because Bencode has no native support for these types.

Lists and Dictionaries
======================
Expand Down
5 changes: 2 additions & 3 deletions docs/encoding.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Encoding
Scalars and arrays
==================

.. versionchanged:: 4.1 floats now throw an exception instead of becoming strings

.. code-block:: php
<?php
Expand All @@ -19,8 +21,6 @@ Scalars and arrays
'arr' => [1,2,3,4],
// integer is stored as is
'int' => 123,
// float will become a string
'float' => 3.1415,
// true will be an integer 1
'true' => true,
// false and null values will be skipped
Expand All @@ -30,7 +30,6 @@ Scalars and arrays
]);
// "d" .
// "3:arr" . "l" . "i1e" . "i2e" . "i3e" . "i4e" . "e" .
// "5:float" . "6:3.1415" .
// "3:int" . "i123e" .
// "6:string" . "9:test\0test" .
// "4:true" . "i1e" .
Expand Down

0 comments on commit b6dae4d

Please sign in to comment.