blob: 1d2bb03ad3e5088f15ed6391969fb7b7c2222891 (
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
28
29
30
31
32
33
34
|
--TEST--
Bug #34310 (foreach($arr as $c->d => $x) crashes)
--FILE--
<?php
class C
{
public $d;
}
$c = new C();
$arr = array (1 => 'a', 2 => 'b', 3 => 'c');
// Works fine:
foreach($arr as $x => $c->d)
{
echo "{$x} => {$c->d}\n";
}
// Crashes:
foreach($arr as $c->d => $x)
{
echo "{$c->d} => {$x}\n";
}
?>
--EXPECT--
1 => a
2 => b
3 => c
1 => a
2 => b
3 => c
|