|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-08-15 22:21 UTC] smaug at thegame dot com
this doesn't work:
function _global($___name) {
eval('global $' . $___name . ';');
eval('return $' . $___name . ';');
}
this version does:
function _global($___name) {
eval('global $' . $___name . ';');
eval('$___temp = $' . $___name . ';');
return $___temp;
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 11 18:00:01 2026 UTC |
a return in an eval() returns from the eval() itself, not from the calling function this would do: function _global($___name) { eval('global $' . $___name . ';'); return eval('return $' . $___name . ';'); }