mirror of
https://github.com/php/php-src.git
synced 2026-04-21 23:18:13 +02:00
625f164963
There are two main motivations to this: a) The logic for handling internal and userland observation can be unified. b) Unwinding of observed functions on a bailout does notably not include observers. Even if users of observers were to ensure such handling themselves, it would be impossible to retain the relative ordering - either the user has to unwind all internal observed frames before the automatic unwinding (zend_observer_fcall_end_all) or afterwards, but not properly interleaved. Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
32 lines
546 B
PHP
32 lines
546 B
PHP
--TEST--
|
|
Observer: End handlers fire after a userland fatal error
|
|
--EXTENSIONS--
|
|
zend_test
|
|
--INI--
|
|
zend_test.observer.enabled=1
|
|
zend_test.observer.observe_all=1
|
|
zend_test.observer.show_return_value=1
|
|
--FILE--
|
|
<?php
|
|
function foo()
|
|
{
|
|
trigger_error('Foo error', E_USER_ERROR);
|
|
}
|
|
|
|
foo();
|
|
|
|
echo 'You should not see this.';
|
|
?>
|
|
--EXPECTF--
|
|
<!-- init '%s' -->
|
|
<file '%s'>
|
|
<!-- init foo() -->
|
|
<foo>
|
|
<!-- init trigger_error() -->
|
|
<trigger_error>
|
|
|
|
Fatal error: Foo error in %s on line %d
|
|
</trigger_error:NULL>
|
|
</foo:NULL>
|
|
</file '%s'>
|