--TEST-- Test DeprecationErrorHandler in default mode --FILE-- testLegacyFoo(); $foo->testNonLegacyBar(); register_shutdown_function(function () { exit('I get precedence over any exit statements inside the deprecation error handler.'); }); ?> --EXPECTF-- Unsilenced deprecation notices (3) 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo 1x: unsilenced bar deprecation 1x in FooTestCase::testNonLegacyBar Remaining deprecation notices (1) 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar Legacy deprecation notices (1) Other deprecation notices (1) 1x: root deprecation I get precedence over any exit statements inside the deprecation error handler.