From 4106cf45038389e94a75585851c62c89667a0c38 Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Wed, 16 Aug 2000 09:08:39 +0000 Subject: [PATCH] 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 --- language/functions.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/language/functions.xml b/language/functions.xml index 4c7d948135..930348bd01 100644 --- a/language/functions.xml +++ b/language/functions.xml @@ -255,6 +255,20 @@ list ($zero, $one, $two) = small_numbers(); + + 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: + + +function &returns_reference() { + return &$someref; +} + +$newref = &returns_reference(); + + +