php-src/ext/opcache/tests/preload_variance_ind.inc
Nikita Popov d836046ab8 Perform preloading attempt on copied class
It is very hard to determine in advance whether class linking will
fail due to missing dependencies in variance checks (#7314 attempts
this). This patch takes an alternative approach where we try to
perform inheritance on a copy of the class (zend_lazy_class_load)
and then restore the original class if inheritance fails. The fatal
error in that case is recorded and thrown as a warning later.

Closes GH-7319.
2021-07-30 15:09:49 +02:00

7 lines
189 B
PHP

<?php
spl_autoload_register(function($class) {
// Autoloader should not get called.
echo "Trying to autoload $class\n";
});
opcache_compile_file(__DIR__ . '/preload_variance.inc');