note 99545 deleted from language.references.pass by danbrown
| From: | danbrown@php.net | Date: | Tue, 24 Aug 2010 03:39:11 +0000 |
| Subject: | note 99545 deleted from language.references.pass by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171960@lists.php.net to get a copy of this message | ||
Note Submitter: northhero at gmail dot com
----
In response to ben at mekhaye dot net, just changed the third parameter from $arr to &$arr, I
also got the result as expected.
$arr = Array();
call_user_func(Array("ClassName","functionName"), $param1, $param2,
&$arr);
print_r($arr);
class ClassName {
function functionName($param1, $param2, &$arr) {
$arr[0] = "apple";
$arr[1] = "banana";
print_r($arr);
}
}
Output was the expected:
Array ( [0] => "apple" [1] => "banana" )
Array ( [0] => "apple" [1] => "banana" )