Merge one more common user comment merged

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@290729 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christopher Jones 2009-11-14 00:46:30 +00:00
parent 80fd12d9ef
commit 74889fd2f8

View file

@ -785,6 +785,35 @@ print '</table>';
succeed.
</para>
</note>
<note>
<para>
The PHP <parameter>variable</parameter> argument is a reference. Some
forms of loops do not work as expected:
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
foreach ($myarray as $key => $value) {
oci_bind_by_name($stid, $key, $value);
}
]]>
</programlisting>
</informalexample>
<para>
This binds each key to the location of $value, so all bound
variables end up pointing to the last loop iteration's
value. Instead use the following:
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
foreach ($myarray as $key => $value) {
oci_bind_by_name($stid, $key, $myarray[$key]);
}
]]>
</programlisting>
</informalexample>
</note>
<note>
<para>
In PHP versions before 5.0.0 you must