#31822 [NEW]: __FUNCTION__ magic constant doesn't work in eval()

From: Date: Wed, 02 Feb 2005 23:35:23 +0000
Subject: #31822 [NEW]: __FUNCTION__ magic constant doesn't work in eval()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-73302@lists.php.net to get a copy of this message
From: clewis at myfonts dot com Operating system: RedHat Enterprise 3 PHP version: 5.0.3 PHP Bug Type: Zend Engine 2 problem Bug description: __FUNCTION__ magic constant doesn't work in eval() Description: ------------ The __FUNCTION__ magic constant returns nothing when used in eval()'d code. __FILE__ and __LINE__ work as expected. Reproduce code: --------------- <?php function whatFunctionAmI() { eval("print 'the function is: ' . __FUNCTION__;"); } whatFunctionAmI(); ?> Expected result: ---------------- the function is: whatFunctionAmI Actual result: -------------- the function is: -- Edit bug report at http://bugs.php.net/?id=31822&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31822&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31822&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31822&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31822&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31822&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31822&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31822&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31822&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31822&r=support Expected behavior: http://bugs.php.net/fix.php?id=31822&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31822&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31822&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31822&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31822&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31822&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31822&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31822&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31822&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31822&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31822&r=mysqlcfg

« previous php.bugs (#73302) next »