note 28920 deleted from function.eval by danbrown
| From: | danbrown@php.net | Date: | Tue, 25 Nov 2008 16:11:08 +0000 |
| Subject: | note 28920 deleted from function.eval by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146953@lists.php.net to get a copy of this message | ||
Note Submitter: Smooth
----
/* It seems that eval() won't return by reference: */
function &get_ref ($var) {
...
return $reference;
}
/* The following code returns a parse error */
/* (expecting
T_NEW' or T_STRING' or T_VARIABLE' or
'$'') */
$r =& eval ('return get_ref ($v);');
/* But thinking "inside the box" you can always do this... */
eval ('$r =& get_ref ($v);');
(I'm using PHP Version 4.2.3)