You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
runtime: run php real-world.php
you see the program runs, without the custom autoloader of e2e/bug-12972b/autoloader.php beeing invoked.
all involved classes are autoloaded by the composer class loader. the custom class loader is not invoked for \other12972\MyClass::class.
static analysis time: run ../../bin/phpstan analyze
you see PHPStan invokes the custom class loader for class \other12972\MyClass::class, which does not happen at regular runtime. the composer class loader is not invoked for \other12972\MyClass::class (like it is at runtime).
because of the difference in autoloading functions order in runtime vs. analysis time we see errors which cannot happen at runtime
Code snippet that reproduces the problem
No response
Expected output
phpstan should not analyze the code as if the autoloader was invoked (as we saw it isn't at runtime)
Did PHPStan help you today? Did it make you happy in any way?
Bug report
the PR at phpstan/phpstan-src#4003 adds a end-to-end test which fails atm.
runtime: run
php real-world.phpyou see the program runs, without the custom autoloader of
e2e/bug-12972b/autoloader.phpbeeing invoked.all involved classes are autoloaded by the composer class loader. the custom class loader is not invoked for
\other12972\MyClass::class.static analysis time: run
../../bin/phpstan analyzeyou see PHPStan invokes the custom class loader for class
\other12972\MyClass::class, which does not happen at regular runtime. the composer class loader is not invoked for\other12972\MyClass::class(like it is at runtime).because of the difference in autoloading functions order in runtime vs. analysis time we see errors which cannot happen at runtime
Code snippet that reproduces the problem
No response
Expected output
phpstan should not analyze the code as if the autoloader was invoked (as we saw it isn't at runtime)
Did PHPStan help you today? Did it make you happy in any way?
No response