1--TEST--
2Observer: End handlers fire after a fatal error
3--SKIPIF--
4<?php if (!extension_loaded('zend-test')) die('skip: zend-test extension required'); ?>
5--INI--
6zend_test.observer.enabled=1
7zend_test.observer.observe_all=1
8zend_test.observer.show_return_value=1
9memory_limit=1M
10--FILE--
11<?php
12function foo()
13{
14    str_repeat('.', 1024 * 1024 * 2); // 2MB
15}
16
17foo();
18
19echo 'You should not see this.';
20?>
21--EXPECTF--
22<!-- init '%s%eobserver_error_%d.php' -->
23<file '%s%eobserver_error_%d.php'>
24  <!-- init foo() -->
25  <foo>
26
27Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
28  </foo:NULL>
29</file '%s%eobserver_error_%d.php'>
30