]> granicus.if.org Git - php/commitdiff
add test
authorAntony Dovgal <tony2001@php.net>
Wed, 11 Feb 2009 10:02:28 +0000 (10:02 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 11 Feb 2009 10:02:28 +0000 (10:02 +0000)
Zend/tests/bug47353.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug47353.phpt b/Zend/tests/bug47353.phpt
new file mode 100644 (file)
index 0000000..4196fc7
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+Bug #47353 (crash when creating a lot of objects in object destructor)
+--FILE--
+<?php
+
+class A
+{
+       function __destruct()
+       {
+               $myArray = array();
+
+               for($i = 1; $i <= 3000; $i++) {
+                       if(!isset($myArray[$i]))
+                               $myArray[$i] = array();
+                       $ref = & $myArray[$i];
+                       $ref[] = new stdClass();
+               }
+       }
+}
+
+$a = new A();
+
+echo "Done\n";
+?>
+--EXPECTF--    
+Done