#36370 [NEW]: __FUNCTION__ doesn't persist into include files

From: Date: Sun, 12 Feb 2006 03:03:11 +0000
Subject: #36370 [NEW]: __FUNCTION__ doesn't persist into include files
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93168@lists.php.net to get a copy of this message
From: rbro at hotmail dot com Operating system: Linux PHP version: 5.1.2 PHP Bug Type: Scripting Engine problem Bug description: __FUNCTION__ doesn't persist into include files Description: ------------ If you include a file within a function, the constant __FUNCTION__ is not available from that include file. Reproduce code: --------------- <?php function test() { echo "1. Function is: ".__FUNCTION__."\n"; require('b.php'); } test(); ?> ------- File b.php contains: <?php echo "2. Function is: ".__FUNCTION__."\n"; ?> Expected result: ---------------- 1. Function is: test 2. Function is: test Actual result: -------------- 1. Function is: test 2. Function is: -- Edit bug report at http://bugs.php.net/?id=36370&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36370&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36370&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36370&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36370&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36370&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36370&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36370&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36370&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36370&r=support Expected behavior: http://bugs.php.net/fix.php?id=36370&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36370&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36370&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36370&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36370&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36370&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36370&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36370&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36370&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36370&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36370&r=mysqlcfg

« previous php.bugs (#93168) next »