1--TEST--
2Bug #81430 (Attribute instantiation leaves dangling execute_data pointer)
3--EXTENSIONS--
4zend_test
5--INI--
6memory_limit=20M
7zend_test.observer.enabled=1
8zend_test.observer.show_output=1
9zend_test.observer.observe_all=1
10--SKIPIF--
11<?php
12if (getenv("USE_ZEND_ALLOC") === "0") die("skip requires zmm");
13?>
14--FILE--
15<?php
16
17#[\Attribute]
18class A {
19    public function __construct() {
20        array_map("str_repeat", ["\xFF"], [100000000]); // cause a bailout
21    }
22}
23
24#[A]
25function B() {}
26
27$r = new \ReflectionFunction("B");
28call_user_func([$r->getAttributes(A::class)[0], 'newInstance']);
29?>
30--EXPECTF--
31<!-- init '%s' -->
32<file '%s'>
33  <!-- init ReflectionFunction::__construct() -->
34  <ReflectionFunction::__construct>
35  </ReflectionFunction::__construct>
36  <!-- init ReflectionFunctionAbstract::getAttributes() -->
37  <ReflectionFunctionAbstract::getAttributes>
38  </ReflectionFunctionAbstract::getAttributes>
39  <!-- init ReflectionAttribute::newInstance() -->
40  <ReflectionAttribute::newInstance>
41    <!-- init A::__construct() -->
42    <A::__construct>
43      <!-- init array_map() -->
44      <array_map>
45        <!-- init str_repeat() -->
46        <str_repeat>
47
48Fatal error: Allowed memory size of %d bytes exhausted %s in %s on line %d
49        </str_repeat>
50      </array_map>
51    </A::__construct>
52  </ReflectionAttribute::newInstance>
53</file '%s'>
54