<?php
set_error_handler(function() {
throw new Exception();
});
class A
{
public function method($test = UNKNOWN_CONSTANT)
{
}
}
$class = new ReflectionClass('A');
echo $class;
Fatal error: Uncaught Error: Undefined constant "UNKNOWN_CONSTANT" in /in/ekEkd:16
Stack trace:
#0 /in/ekEkd(16): ReflectionClass->__toString()
#1 {main}
thrown in /in/ekEkd on line 16
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Uncaught Exception in /in/ekEkd:4
Stack trace:
#0 [internal function]: {closure}(2, 'Use of undefine...', '/in/ekEkd', 16, Array)
#1 /in/ekEkd(16): ReflectionClass->__toString()
#2 {main}
thrown in /in/ekEkd on line 4
Process exited with code 255.