Skip to content

Commit b6dae4d

Browse files
committed
Changelog and docs for 4.1
1 parent 7ecca82 commit b6dae4d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## 4.x
44

5+
### 4.1.0
6+
7+
*Jul 14, 2023*
8+
9+
* Removed implicit conversion of floats to strings.
10+
Since it was unreliable, it's not considered a BC break.
11+
512
### 4.0.0
613

714
*Dec 14, 2022*

docs/decoding.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@ Scalars will be converted to their respective types.
1919
"d" .
2020
"3:arrli1ei2ei3ei4ee" .
2121
"4:booli1e" .
22-
"5:float6:3.1415" .
2322
"3:inti123e" .
2423
"6:string9:test\0test" .
2524
"e"
2625
);
2726
// [
2827
// "arr" => [1,2,3,4],
2928
// "bool" => 1,
30-
// "float" => "3.1415",
3129
// "int" => 123,
3230
// "string" => "test\0test",
3331
// ]
3432
35-
Please note that floats and booleans will stay converted because Bencode has no native support for these types.
33+
Please note that booleans will stay converted because Bencode has no native support for these types.
3634

3735
Lists and Dictionaries
3836
======================

docs/encoding.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Encoding
77
Scalars and arrays
88
==================
99

10+
.. versionchanged:: 4.1 floats now throw an exception instead of becoming strings
11+
1012
.. code-block:: php
1113
1214
<?php
@@ -19,8 +21,6 @@ Scalars and arrays
1921
'arr' => [1,2,3,4],
2022
// integer is stored as is
2123
'int' => 123,
22-
// float will become a string
23-
'float' => 3.1415,
2424
// true will be an integer 1
2525
'true' => true,
2626
// false and null values will be skipped
@@ -30,7 +30,6 @@ Scalars and arrays
3030
]);
3131
// "d" .
3232
// "3:arr" . "l" . "i1e" . "i2e" . "i3e" . "i4e" . "e" .
33-
// "5:float" . "6:3.1415" .
3433
// "3:int" . "i123e" .
3534
// "6:string" . "9:test\0test" .
3635
// "4:true" . "i1e" .

0 commit comments

Comments
 (0)