Bug #64346 [Com]: Function name resolution and eval

From: Date: Sat, 12 Nov 2016 11:48:14 +0000
Subject: Bug #64346 [Com]: Function name resolution and eval
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205320@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64346&edit=1 ID: 64346 Comment by: showerheadsuk at hotmail dot com Reported by: gen dot work at gmail dot com Summary: Function name resolution and eval Status: Assigned Type: Bug Package: *General Issues Operating System: Ubuntu 12.10 PHP Version: 5.4.12 Assigned To: dmitry Block user comment: N Private report: N New Comment: The same problem also applies to constants when accessing from a namespaced class - if the first the time the constant is accessed it is defined globally but not in the local namespace, then that global value will be used for all future accesses even if it is later defined in the local namespace. Since overriding global functions / constants is mostly used just for testing, could this be added as a php.ini option, like literal_cache_disable = 1 Previous Comments: ------------------------------------------------------------------------ [2016-05-31 20:22:20] cmb@php.net Related To: Bug #68541 ------------------------------------------------------------------------ [2015-01-29 10:32:39] gen dot work at gmail dot com Related To: Bug #68541 ------------------------------------------------------------------------ [2013-12-08 16:18:05] Terry at ellisons dot org dot uk Damn, why can't you edit your own comments :-) The include should read: include "some_include_in_namespace_fred_which overrides_same_builtin.php"; of course. ------------------------------------------------------------------------ [2013-12-08 16:16:25] Terry at ellisons dot org dot uk BTW, the title of this bug is misleading. It can still occur for *any* INCLUDE_OR_EVAL of a namespaced override of a builtin function, eg. namespace fred; some_function_which_executes_builtin(); include "some_include_in_namespace_fred_which overrides_same_builtin(); some_function_which_executes_builtin(); ------------------------------------------------------------------------ [2013-12-02 16:57:46] Terry at ellisons dot org dot uk Dmitry, I came across this one myself (see http://3v4l.org/KSIDh) and found this bugrep when I came to report it. I think that one-time caching as we've started to do with function look-up is an important performance feature, and something that we should look to extend -- though this is a wider discussion than this bugrep, probably a DL list discussion. I haven't gone through the current implementation yet, but my immediate thought is that this really just a cache-coherence issue in a cache where the invalidation rates are very low, so even if cache flushing was a relatively expensive operation, then the expected (that is average) overhead would still be small. I want to think about this some more and look at the performance issues around some approaches, before posting further -- Terry ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=64346 -- Edit this bug report at https://bugs.php.net/bug.php?id=64346&edit=1

« previous php.bugs (#205320) next »