]> granicus.if.org Git - php/commitdiff
add test for bug #34873
authorAntony Dovgal <tony2001@php.net>
Fri, 14 Oct 2005 21:50:46 +0000 (21:50 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 14 Oct 2005 21:50:46 +0000 (21:50 +0000)
Zend/tests/bug34873.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug34873.phpt b/Zend/tests/bug34873.phpt
new file mode 100644 (file)
index 0000000..d8683c9
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+bug #34873 (Segmentation Fault on foreach in object)
+--FILE--
+<?php
+class pwa {
+       public $var;
+
+       function __construct(){
+               $this->var = array();
+       }
+
+       function test (){
+               $cont = array();
+               $cont["mykey"] = "myvalue";
+
+               foreach ($cont as $this->var['key'] => $this->var['value'])
+               var_dump($this->var['value']);
+       }
+}
+$myPwa = new Pwa();
+$myPwa->test();
+
+echo "Done\n";
+?>
+--EXPECT--     
+string(7) "myvalue"
+Done