1--TEST-- 2SplFixedArray::setSize in offsetSet destructor (#81429) 3--FILE-- 4<?php 5$values = new SplFixedArray(1); 6$values->offsetSet(0, new HasDestructor()); 7$values->offsetSet(0, false); 8echo "Done\n"; 9 10class HasDestructor { 11 public function __destruct() { 12 global $values; 13 var_dump($values); 14 $values->setSize($values->getSize() - 1); 15 var_dump($values); 16 } 17} 18 19$values->setSize(5); 20$values->offsetSet(4, new HasDestructor()); 21echo "Done\n"; 22--EXPECT-- 23object(SplFixedArray)#1 (1) { 24 [0]=> 25 bool(false) 26} 27object(SplFixedArray)#1 (1) { 28 [0]=> 29 bool(false) 30} 31Done 32Done 33object(SplFixedArray)#1 (5) { 34 [0]=> 35 NULL 36 [1]=> 37 NULL 38 [2]=> 39 NULL 40 [3]=> 41 NULL 42 [4]=> 43 object(HasDestructor)#2 (0) { 44 } 45} 46object(SplFixedArray)#1 (4) { 47 [0]=> 48 NULL 49 [1]=> 50 NULL 51 [2]=> 52 NULL 53 [3]=> 54 NULL 55} 56