- Notifications
You must be signed in to change notification settings - Fork8k
Closed
Description
Description
This code should blame line 4, not line 7, since that's where the bogus constant is actually declared.
An example of where this is more problematic:
SomeClass.php
<?phpclass SomeClass{publicconstINGOT = IDontExist::INGOT;}
test.php
<?phprequire'SomeClass.php';newSomeClass();
Resulted in this output:
Fatal error: Uncaught Error: Class "IDontExist" not found in C:\stable\test4.php:5
But I expected this output instead:
Fatal error: Uncaught Error: Class "IDontExist" not found in C:\stable\SomeClass.php:4
This frequently causes issues with my telemetry because incorrect subsystems are getting blamed for errors when third-party plugin code comes into play.
PHP Version
8.0.13
Operating System
Windows (doubtful if relevant)