note 82240 deleted from function.eval by levim

From: Date: Fri, 06 Dec 2013 21:29:00 +0000
Subject: note 82240 deleted from function.eval by levim
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-197822@lists.php.net to get a copy of this message
Note Submitter: Ivan Zahariev ---- It seems that the Magic constants (http://www.php.net/manual/en/language.constants.predefined.php) do NOT work in an eval()'ed code. Probably because PHP substitutes these statically when it compiles the source code of your PHP script initially. So the following will not work as expected: <?php function user_func1() { echo "User function name: ".__FUNCTION__."\n"; eval('echo "in eval(): User function name: ".__FUNCTION__."\n";'); } ?> Calling user_func1() will output: User function name: user_func1 User function name:

« previous php.notes (#197822) next »