File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 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*
Original file line number Diff line number Diff 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
3735Lists and Dictionaries
3836======================
Original file line number Diff line number Diff line change 77Scalars 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" .
You can’t perform that action at this time.
0 commit comments