Commit b6dae4d0 authored by Anton Smirnov's avatar Anton Smirnov
Browse files

Changelog and docs for 4.1

parent 7ecca82e
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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*
+1 −3
Original line number Diff line number Diff line
@@ -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
======================
+2 −3
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ Encoding
Scalars and arrays
==================

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

.. code-block:: php

    <?php
@@ -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
@@ -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" .