#36370 [Opn->Bgs]: __FUNCTION__ doesn't persist into include files

From: Date: Sun, 12 Feb 2006 13:22:09 +0000
Subject: #36370 [Opn->Bgs]: __FUNCTION__ doesn't persist into include files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93177@lists.php.net to get a copy of this message
ID: 36370 Updated by: johannes@php.net Reported By: rbro at hotmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.1.2 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2006-02-12 04:03:10] rbro at hotmail dot com 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 this bug report at http://bugs.php.net/?id=36370&edit=1

« previous php.bugs (#93177) next »