New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check that all "required" classes can be preloaded #4997
Conversation
@@ -12,5 +12,4 @@ opcache.preload={PWD}/preload_undef_const.inc | |||
var_dump(class_exists('Foo')); | |||
?> | |||
--EXPECTF-- | |||
Warning: Can't preload class Foo with unresolved initializer for constant A in %spreload_undef_const.inc on line 2 | |||
bool(false) | |||
Fatal error: Undefined class constant 'self::DOES_NOT_EXIST' in Unknown on line 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be add a hint to try preloading through opcache_compile_file()?
@@ -13,6 +13,6 @@ var_dump(trait_exists('T')); | |||
var_dump(class_exists('Foo')); | |||
?> | |||
--EXPECTF-- | |||
Warning: Can't preload class Foo with unresolved initializer for constant C in %spreload_undef_const_2.inc on line 8 | |||
Warning: Use of undefined constant UNDEF - assumed 'UNDEF' (this will throw an Error in a future version of PHP) in Unknown on line 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a questionable decision. It may be better to throw error with a hint to try preloading through opcache_compile_file(). Anyway, this may be fixed later.
1196efc
to
43a70b3
Compare
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.