From b6dae4d03d233949be32da438548115c9017e784 Mon Sep 17 00:00:00 2001 From: Anton Smirnov Date: Fri, 14 Jul 2023 20:01:14 +0300 Subject: [PATCH] Changelog and docs for 4.1 --- CHANGELOG.md | 7 +++++++ docs/decoding.rst | 4 +--- docs/encoding.rst | 5 ++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dab889..16863a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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* diff --git a/docs/decoding.rst b/docs/decoding.rst index 325dd19..0d13896 100644 --- a/docs/decoding.rst +++ b/docs/decoding.rst @@ -19,7 +19,6 @@ Scalars will be converted to their respective types. "d" . "3:arrli1ei2ei3ei4ee" . "4:booli1e" . - "5:float6:3.1415" . "3:inti123e" . "6:string9:test\0test" . "e" @@ -27,12 +26,11 @@ Scalars will be converted to their respective types. // [ // "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 ====================== diff --git a/docs/encoding.rst b/docs/encoding.rst index 284d67f..b4134fa 100644 --- a/docs/encoding.rst +++ b/docs/encoding.rst @@ -7,6 +7,8 @@ Encoding Scalars and arrays ================== +.. versionchanged:: 4.1 floats now throw an exception instead of becoming strings + .. code-block:: php [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 @@ -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" .