--TEST-- #[\Deprecated]: Using the value of a deprecated class constant as the deprecation message with a throwing error handler. --FILE-- getMessage(), PHP_EOL; } try { Clazz::TEST3; } catch (ErrorException $e) { echo "Caught: ", $e->getMessage(), PHP_EOL; } ?> --EXPECT-- Caught: Constant Clazz::TEST is deprecated, from itself Caught: Constant Clazz::TEST2 is deprecated