mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
80fd12d9ef
commit
74889fd2f8
1 changed files with 29 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue