php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66338 Optimization binding of class constants is not safely opcacheable
Submitted: 2013-12-23 00:32 UTC Modified: -
From: Terry at ellisons dot org dot uk Assigned:
Status: Closed Package: opcache
PHP Version: master-Git-2013-12-23 (Git) OS: N/A
Private report: No CVE-ID: None
 [2013-12-23 00:32 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-23 12:55 UTC] dmitry@php.net
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)
 [2013-12-23 12:55 UTC] dmitry@php.net
-Status: Open +Status: Closed
 [2013-12-23 20:15 UTC] ab@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=276b9767e4aa3f16a2280f99fa2f13480c03f0e6
Log: Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable)
 [2013-12-23 22:43 UTC] ab@php.net
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)
 [2014-08-22 07:07 UTC] ab@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=276b9767e4aa3f16a2280f99fa2f13480c03f0e6
Log: Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable)
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=276b9767e4aa3f16a2280f99fa2f13480c03f0e6
Log: Fixed bug #66338 (Optimization binding of class constants is not safely opcacheable)
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Aug 23 21:01:28 2019 UTC