Description
- when parent class is not defined:
The following code:
<?php
new A;
class A extends B {
}
Resulted in this output:
Fatal error: Uncaught Error: Class "A" not found
But I expected this output instead:
Fatal error: Uncaught Error: Class "A" parent Class "B" not found
- the parent class defined in other file:
In test2.php define class B:
In test.php extend class B:
<?php
include_once 'test2.php';
new A; //if after define Class A will correct
class A extends B{
}
Resulted in this output:
Fatal error: Uncaught Error: Class "A" not found
But I expected this no Error be throwed
- in same file, no error
class B {}
new A;
class A extends B {}
//other defined
new A;
class B {}
class A extends B {}
PHP Version
PHP 8.3 and 8.4 and 8.5.0-dev
Operating System
No response