diff --git a/appendices/migration55.xml b/appendices/migration55.xml index 6fd7c0d0a6..bbc3c71bd9 100644 --- a/appendices/migration55.xml +++ b/appendices/migration55.xml @@ -423,6 +423,17 @@ String dereferencing: P + + <link linkend="control-structures.foreach"><literal>foreach</literal></link> now supports non-scalar keys + + + foreach now supports + keys of any type. While non-scalar keys cannot occur in native PHP arrays, + it is possible for Iterator::key to return a + value of any type, and this will now be handled correctly. + + + Apache 2.4 handler supported on Windows diff --git a/reference/spl/functions/iterator-to-array.xml b/reference/spl/functions/iterator-to-array.xml index 670da442d9..ad905ba61b 100644 --- a/reference/spl/functions/iterator-to-array.xml +++ b/reference/spl/functions/iterator-to-array.xml @@ -36,6 +36,15 @@ Whether to use the iterator element keys as index. + + In PHP 5.5 and later, if a key is an array or + object, a warning will be generated. &null; keys will be + converted to an empty string, double keys will be + truncated to their integer counterpart, + resource keys will generate a warning and be converted to + their resource ID, and boolean keys will be converted to + integers. + @@ -61,6 +70,14 @@ + + 5.5.0 + + iterator_to_array gained support for key types + other than integer and string when the + use_keys parameter is enabled. + + 5.2.1