2005-10-14 21:52:18 +00:00
|
|
|
--TEST--
|
2006-04-14 21:06:11 +00:00
|
|
|
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
|