php-src/tests/classes/bug75765.phpt
timurib a484b9a535 Fix #75765 Exception on extend of undefined class
As the parent class is fetched prior to binding, there are no
safety concerns in this case and we can replace the fatal error
with an Error exception.
2018-01-12 18:41:39 +01:00

23 lines
381 B
PHP

--TEST--
Ensure that extending of undefined class throws the exception
--FILE--
<?php
try {
class A extends B {}
} catch (Error $e) {
var_dump(class_exists('A'));
var_dump(class_exists('B'));
throw $e;
}
?>
--EXPECTF--
bool(false)
bool(false)
Fatal error: Uncaught Error: Class 'B' not found in %sbug75765.php:%d
Stack trace:
#0 {main}
thrown in %sbug75765.php on line %d