Annotation of embedaddon/php/ext/spl/tests/bug64264.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #64264 (SPLFixedArray toArray problem)
! 3: --FILE--
! 4: <?php
! 5: class MyFixedArray extends \SplFixedArray {
! 6: protected $foo;
! 7: protected $bar;
! 8: }
! 9:
! 10: $myFixedArr = new MyFixedArray(1);
! 11: $myFixedArr[0] = 'foo';
! 12: $myFixedArr->setSize(2);
! 13: $myFixedArr[1] = 'bar';
! 14: $myFixedArr->setSize(5);
! 15: $array = $myFixedArr->toArray();
! 16: $array[2] = "ERROR";
! 17: $array[3] = "ERROR";
! 18: $array[4] = "ERROR";
! 19: unset($array[4]);
! 20: $myFixedArr->setSize(2);
! 21:
! 22: print_r($myFixedArr->toArray());
! 23: ?>
! 24: --EXPECTF--
! 25: Array
! 26: (
! 27: [0] => foo
! 28: [1] => bar
! 29: )
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>