Reference returning from a function (fixing example, text)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@35194 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Ron Chmara 2000-11-03 03:49:38 +00:00
parent f18b0b61dd
commit 04efa58936

View file

@ -258,14 +258,14 @@ list ($zero, $one, $two) = small_numbers();
<para>
To return a reference from a function, you have to use
the reference operator &amp; in both the function declaration and
when assigning the return value to a variable:
when assigning the returned value to a variable:
<informalexample>
<programlisting role="php">
function &amp;returns_reference() {
return &amp;$someref;
return $someref;
}
$newref = &amp;returns_reference();
$newref =&amp;returns_reference();
</programlisting>
</informalexample>
</para>