1--TEST-- 2Bug #81430 (Attribute instantiation leaves dangling execute_data pointer) 3--SKIPIF-- 4<?php 5if (!extension_loaded("zend-test")) die("skip zend_test extension not available"); 6?> 7--INI-- 8memory_limit=20M 9zend_test.observer.enabled=1 10zend_test.observer.observe_all=1 11--FILE-- 12<?php 13 14#[\Attribute] 15class A { 16 public function __construct() { 17 array_map("str_repeat", ["\xFF"], [100000000]); // cause a bailout 18 } 19} 20 21#[A] 22function B() {} 23 24$r = new \ReflectionFunction("B"); 25call_user_func([$r->getAttributes(A::class)[0], 'newInstance']); 26?> 27--EXPECTF-- 28<!-- init '%s' --> 29<file '%s'> 30 <!-- init A::__construct() --> 31 <A::__construct> 32 33Fatal error: Allowed memory size of %d bytes exhausted %s in %s on line %d 34 </A::__construct> 35</file '%s'> 36