Add the new support for non-scalar keys in foreach.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330578 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Adam Harvey 2013-06-20 23:35:15 +00:00
parent 0709afc51e
commit f878df475d
2 changed files with 28 additions and 0 deletions

View file

@ -423,6 +423,17 @@ String dereferencing: P
</para>
</sect2>
<sect2 xml:id="migration55.new-features.non-scalar-iterator-keys">
<title><link linkend="control-structures.foreach"><literal>foreach</literal></link> now supports non-scalar keys</title>
<para>
<link linkend="control-structures.foreach">foreach</link> now supports
keys of any type. While non-scalar keys cannot occur in native PHP arrays,
it is possible for <methodname>Iterator::key</methodname> to return a
value of any type, and this will now be handled correctly.
</para>
</sect2>
<sect2 xml:id="migration55.new-features.windows-apache">
<title>Apache 2.4 handler supported on Windows</title>

View file

@ -36,6 +36,15 @@
<para>
Whether to use the iterator element keys as index.
</para>
<para>
In PHP 5.5 and later, if a key is an <type>array</type> or
<type>object</type>, a warning will be generated. &null; keys will be
converted to an empty string, <type>double</type> keys will be
truncated to their <type>integer</type> counterpart,
<type>resource</type> keys will generate a warning and be converted to
their resource ID, and <type>boolean</type> keys will be converted to
integers.
</para>
</listitem>
</varlistentry>
</variablelist>
@ -61,6 +70,14 @@
</row>
</thead>
<tbody>
<row>
<entry>5.5.0</entry>
<entry>
<function>iterator_to_array</function> gained support for key types
other than <type>integer</type> and <type>string</type> when the
<parameter>use_keys</parameter> parameter is enabled.
</entry>
</row>
<row>
<entry>5.2.1</entry>
<entry>