mirror of
https://github.com/php/php-src.git
synced 2025-01-09 20:44:33 +08:00
3f86adb0ef
During preloading, check that all classes that have been included as part of the preload script itself (rather than through opcache_compile_file) can actually be preloaded, i.e. satisfy Windows restrictions, have resolved initializers and resolved property types. When resolving initializers and property types, also autoload additional classes. Because of this, the resolution runs in a loop.
19 lines
296 B
PHP
19 lines
296 B
PHP
<?php
|
|
|
|
spl_autoload_register(function($class) {
|
|
if ($class == 'Bar') {
|
|
class Bar {
|
|
const BAZ = 42;
|
|
|
|
public self $x;
|
|
public Foo $y;
|
|
}
|
|
} else if ($class == 'Foo') {
|
|
class Foo {}
|
|
}
|
|
});
|
|
|
|
class Test {
|
|
const FOO = Bar::BAZ;
|
|
}
|