note 43478 deleted from function.call-user-func by aidan
| From: | aidan@php.net | Date: | Tue, 31 Aug 2004 06:54:51 +0000 |
| Subject: | note 43478 deleted from function.call-user-func by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75714@lists.php.net to get a copy of this message | ||
Note Submitter: napalm at spiderfish dot net
----
Just a tip that kept me busy for a while.
<?
function fun(&$arg) {
$arg++;
}
$var = 0;
call_user_func("fun", $var);
echo $var; //echoes 0 instead of 1
?>
As you can see the variable passed to "fun" is actually a copy of $var and not the
variable itself.
In this case you have to use other method to call the function.