summaryrefslogtreecommitdiff
path: root/ext/spl/tests
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2013-02-24 12:58:39 +0800
committerXinchen Hui <laruence@php.net>2013-02-24 12:58:39 +0800
commitd24ac6953ec8ca147243363eeacc8772d265b6cc (patch)
tree2181db4b99ad20b1278a18248f75b0d3746e6ea5 /ext/spl/tests
parent064c62e4cf078cf08a40478dfe0e64bd51789e57 (diff)
parent1b58bd39a637e9ec4ea9e95903b74aefdbd1b596 (diff)
downloadphp-git-d24ac6953ec8ca147243363eeacc8772d265b6cc.tar.gz
Merge branch 'PHP-5.3' into PHP-5.4
Conflicts: ext/spl/spl_fixedarray.c
Diffstat (limited to 'ext/spl/tests')
-rw-r--r--ext/spl/tests/bug64264.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/spl/tests/bug64264.phpt b/ext/spl/tests/bug64264.phpt
new file mode 100644
index 0000000000..e7b695bd82
--- /dev/null
+++ b/ext/spl/tests/bug64264.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #64264 (SPLFixedArray toArray problem)
+--FILE--
+<?php
+class MyFixedArray extends \SplFixedArray {
+ protected $foo;
+ protected $bar;
+}
+
+$myFixedArr = new MyFixedArray(1);
+$myFixedArr[0] = 'foo';
+$myFixedArr->setSize(2);
+$myFixedArr[1] = 'bar';
+$myFixedArr->setSize(5);
+$array = $myFixedArr->toArray();
+$array[2] = "ERROR";
+$array[3] = "ERROR";
+$array[4] = "ERROR";
+unset($array[4]);
+$myFixedArr->setSize(2);
+
+print_r($myFixedArr->toArray());
+?>
+--EXPECTF--
+Array
+(
+ [0] => foo
+ [1] => bar
+)