From: Nikita Popov Date: Tue, 3 Nov 2020 10:50:14 +0000 (+0100) Subject: Don't ignore internal classes during preloading X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51b5f7d67d639fedcc12451a457f09f493f7db34;p=php Don't ignore internal classes during preloading When preloading, it's fine to make use of internal class information, as we do not support Windows. It is also necessary to allow proper variance checks against internal classes. --- diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 39d04f9a95..5f1d80c083 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4450,7 +4450,6 @@ static int accel_preload(const char *config, zend_bool in_child) } CG(compiler_options) |= ZEND_COMPILE_PRELOAD; CG(compiler_options) |= ZEND_COMPILE_HANDLE_OP_ARRAY; - CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES; CG(compiler_options) |= ZEND_COMPILE_DELAYED_BINDING; CG(compiler_options) |= ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION; CG(compiler_options) |= ZEND_COMPILE_IGNORE_OTHER_FILES; diff --git a/ext/opcache/tests/preload_variance.inc b/ext/opcache/tests/preload_variance.inc index 7b2dd7b8ff..b1e84b5b5d 100644 --- a/ext/opcache/tests/preload_variance.inc +++ b/ext/opcache/tests/preload_variance.inc @@ -13,10 +13,12 @@ class B extends Z { class C extends Z { public function method($a): self {} public function method2($a): C {} + public function method3($a): object {} } class D extends C { public function method($a): self {} public function method2($a): D {} + public function method3($a): stdClass {} } // Works.