php-src/Zend/tests/bug34873.phpt

28 lines
462 B
Plaintext
Raw Normal View History

2005-10-14 21:52:18 +00:00
--TEST--
Bug #34873 (Segmentation Fault on foreach in object)
2005-10-14 21:52:18 +00:00
--FILE--
<?php
class pwa {
2020-02-03 21:52:20 +00:00
public $var;
2005-10-14 21:52:18 +00:00
2020-02-03 21:52:20 +00:00
function __construct(){
$this->var = array();
}
2005-10-14 21:52:18 +00:00
2020-02-03 21:52:20 +00:00
function test (){
$cont = array();
$cont["mykey"] = "myvalue";
2005-10-14 21:52:18 +00:00
2020-02-03 21:52:20 +00:00
foreach ($cont as $this->var['key'] => $this->var['value'])
var_dump($this->var['value']);
}
2005-10-14 21:52:18 +00:00
}
$myPwa = new Pwa();
$myPwa->test();
echo "Done\n";
?>
2018-09-16 17:16:42 +00:00
--EXPECT--
2005-10-14 21:52:18 +00:00
string(7) "myvalue"
Done