Bug #78935 [Opn->Csd]: Preloading removes classes that have dependencies
| From: | nikic@php.net | Date: | Tue, 10 Dec 2019 12:12:43 +0000 |
| Subject: | Bug #78935 [Opn->Csd]: Preloading removes classes that have dependencies | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224189@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78935&edit=1
ID: 78935
Updated by: nikic@php.net
Reported by: nikic@php.net
Summary: Preloading removes classes that have dependencies
-Status: Open
+Status: Closed
Type: Bug
Package: opcache
PHP Version: 7.4.0
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3f86adb0efab3a68d87645941dc997d1e6314050
Log: Fixed bug #78935: Check that all linked classes can be preloaded
Previous Comments:
------------------------------------------------------------------------
[2019-12-09 11:10:27] nikic@php.net
Description:
------------
php -d opcache.preload=preload.php script.php
preload.php:
<?php
class A {
const C = UNRESOLVED;
}
class B extends A {
const C = 42;
}
script.php:
<?php
var_dump(class_exists(A::class));
var_dump((new ReflectionClass(B::class))->getParentClass()->newInstance());
Class A will be removed from the preload state because it has unresolved initializers. However in
the meantime B has already been linked, which is preloaded. The end result is that class B has a
missing parent class when preloaded.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78935&edit=1