Re: Bug #61033 __FUNCTION__ doesn't report correctly in alias trait methods

From: Date: Sun, 12 Feb 2012 18:20:01 +0000
Subject: Re: Bug #61033 __FUNCTION__ doesn't report correctly in alias trait methods
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-57812@lists.php.net to get a copy of this message
On Fri 10 Feb 2012 09:49:54 GMT, Stefan Marr wrote:
Hi Marc: On 09 Feb 2012, at 22:36, Marc Easen wrote:
The reason why I feel this should be changes to reflect the actual called function name is that one of main uses of the __FUNCTION__ constant it to refer back to the function that is currently running, for the use recursive functions:
I still maintain the position that __FUNCTION__, as __LINE__ and __FILE__, is supposed to be a lexical constant. (In retro-spective, adapting __CLASS__ to do even more magic might have been a mistake, from a conceptual point of view.)
As with PHP 5.4 you are able change the function name and the class you are running in thanks to traits, so makes sense to update these magic constants to represent the the value at run time as apposed to compile time. __LINE__ and __FILE__ will always be relating to values at compile time. Cheers, Marc

« previous php.internals (#57812) next »