1--TEST-- 2Observer: End handlers fire after a userland fatal error 3--EXTENSIONS-- 4zend_test 5--INI-- 6zend_test.observer.enabled=1 7zend_test.observer.show_output=1 8zend_test.observer.observe_all=1 9zend_test.observer.show_return_value=1 10--FILE-- 11<?php 12set_error_handler(function ($errno, $errstr, $errfile, $errline) { 13 trigger_error('Foo error', E_USER_ERROR); 14}); 15 16function foo() 17{ 18 return $x; // warning 19} 20 21foo(); 22 23echo 'You should not see this.'; 24?> 25--EXPECTF-- 26<!-- init '%s' --> 27<file '%s'> 28 <!-- init set_error_handler() --> 29 <set_error_handler> 30 </set_error_handler:NULL> 31 <!-- init foo() --> 32 <foo> 33 <!-- init {closure:%s:%d}() --> 34 <{closure:%s:%d}> 35 <!-- init trigger_error() --> 36 <trigger_error> 37 38Deprecated: Passing E_USER_ERROR to trigger_error() is deprecated since 8.4, throw an exception or call exit with a string message instead in %s on line %d 39 40Fatal error: Foo error in %s on line %d 41 </trigger_error:NULL> 42 </{closure:%s:%d}:NULL> 43 </foo:NULL> 44</file '%s'> 45