1--TEST--
2Observer: End handlers fire after a 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
10memory_limit=2M
11--SKIPIF--
12<?php
13if (getenv("USE_ZEND_ALLOC") === "0") die("skip requires zmm");
14?>
15--FILE--
16<?php
17function foo()
18{
19    str_repeat('.', 1024 * 1024 * 2); // 2MB
20}
21
22foo();
23
24echo 'You should not see this.';
25?>
26--EXPECTF--
27<!-- init '%s' -->
28<file '%s'>
29  <!-- init foo() -->
30  <foo>
31    <!-- init str_repeat() -->
32    <str_repeat>
33
34Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
35    </str_repeat:NULL>
36  </foo:NULL>
37</file '%s%eobserver_error_%d.php'>
38