mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
short description of functions returning references (see bug id#5813)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30353 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
47b92dda52
commit
4106cf4503
1 changed files with 14 additions and 0 deletions
|
@ -255,6 +255,20 @@ list ($zero, $one, $two) = small_numbers();
|
|||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
To return a reference from a function, you have to use
|
||||
the reference operator & in both the function declaration and
|
||||
when asigning the return value to a variable:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
function &returns_reference() {
|
||||
return &$someref;
|
||||
}
|
||||
|
||||
$newref = &returns_reference();
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
|
|
Loading…
Reference in a new issue