summaryrefslogtreecommitdiff
path: root/Zend/tests/gc_032.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/gc_032.phpt')
-rw-r--r--Zend/tests/gc_032.phpt40
1 files changed, 40 insertions, 0 deletions
diff --git a/Zend/tests/gc_032.phpt b/Zend/tests/gc_032.phpt
new file mode 100644
index 0000000000..615b008e65
--- /dev/null
+++ b/Zend/tests/gc_032.phpt
@@ -0,0 +1,40 @@
+--TEST--
+GC 032: Crash in GC because of invalid reference counting
+--FILE--
+<?php
+$a = array();
+$b =& $a;
+$a[0] = $a;
+debug_zval_dump($a);
+$a = array(array());
+$b =& $a;
+$a[0][0] = $a;
+debug_zval_dump($a);
+?>
+--EXPECT--
+array(1) refcount(1){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ *RECURSION*
+ }
+ }
+}
+array(1) refcount(1){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ array(1) refcount(1){
+ [0]=>
+ array(1) refcount(3){
+ [0]=>
+ array(1) refcount(1){
+ [0]=>
+ *RECURSION*
+ }
+ }
+ }
+ }
+}