mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
f18b0b61dd
commit
04efa58936
1 changed files with 3 additions and 3 deletions
|
@ -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 & 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 &returns_reference() {
|
||||
return &$someref;
|
||||
return $someref;
|
||||
}
|
||||
|
||||
$newref = &returns_reference();
|
||||
$newref =&returns_reference();
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
|
Loading…
Reference in a new issue