Skip to content

Instantly share code, notes, and snippets.

@carbolymer
Created July 7, 2010 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carbolymer/466870 to your computer and use it in GitHub Desktop.
Save carbolymer/466870 to your computer and use it in GitHub Desktop.
<?php
$f = function(&$a)
{
$a = 'b';
};
$o = new stdClass;
$o->u = 5;
call_user_func($f,$o->u);
// $f($o->u); works!
echo $o->u;
?>
[carbolymer@nucleon]:~/Pulpit$ php dev.php
PHP Warning: Parameter 1 to {closure}() expected to be a reference, value given in /home/carbolymer/Pulpit/dev.php on line 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment