summaryrefslogtreecommitdiff
path: root/Zend/tests/bug34873.phpt
blob: fd31842d59d463aab0c58193aebee7d21a3e3e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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