summaryrefslogtreecommitdiff
path: root/Zend/tests/bug65051.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug65051.phpt')
-rw-r--r--Zend/tests/bug65051.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/Zend/tests/bug65051.phpt b/Zend/tests/bug65051.phpt
new file mode 100644
index 0000000000..42febf5b92
--- /dev/null
+++ b/Zend/tests/bug65051.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #65051: count() off by one inside unset()
+--FILE--
+<?php
+
+class Foo {
+ public $array;
+
+ public function __destruct() {
+ var_dump(count($this->array[0]));
+ var_dump($this->array[0]);
+ }
+}
+
+$array = [[new Foo]];
+$array[0][0]->array =& $array;
+unset($array[0][0]);
+
+?>
+--EXPECT--
+int(0)
+array(0) {
+}