Bug #66338 [Opn->Csd]: Optimization binding of class constants is not safely opcacheable

From: Date: Mon, 23 Dec 2013 12:55:24 +0000
Subject: Bug #66338 [Opn->Csd]: Optimization binding of class constants is not safely opcacheable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183448@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66338&edit=1 ID: 66338 Updated by: dmitry@php.net Reported by: Terry at ellisons dot org dot uk Summary: Optimization binding of class constants is not safely opcacheable -Status: Open +Status: Closed Type: Bug Package: opcache Operating System: N/A PHP Version: master-Git-2013-12-23 (Git) Block user comment: N Private report: N New Comment: Automatic comment on behalf of dmitry@zend.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=a00e7f22d2981c0cf10d957df9b90df83894187f Log: Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable) Previous Comments: ------------------------------------------------------------------------ [2013-12-23 00:32:08] Terry at ellisons dot org dot uk Description: ------------ The OPcache optimizer cannot safely bind class constants at compile time. This is because the class itself is not bound until execution -- that is when the script is loaded and not when prepared. This can open up all sorts of pitfalls if the application can have variants of the same class. The attached PHPT gives a trite example, but this is entirely allowable under PHP 5.x and therefore trying to do this is not B/C. Test script: --------------- See PHPT at https://gist.github.com/TerryE/8090105 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66338&edit=1

« previous php.bugs (#183448) next »