Annotation of embedaddon/php/Zend/tests/bug34310.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #34310 (foreach($arr as $c->d => $x) crashes)
! 3: --FILE--
! 4: <?php
! 5:
! 6: class C
! 7: {
! 8: public $d;
! 9: }
! 10:
! 11: $c = new C();
! 12:
! 13: $arr = array (1 => 'a', 2 => 'b', 3 => 'c');
! 14:
! 15: // Works fine:
! 16: foreach($arr as $x => $c->d)
! 17: {
! 18: echo "{$x} => {$c->d}\n";
! 19: }
! 20:
! 21: // Crashes:
! 22: foreach($arr as $c->d => $x)
! 23: {
! 24: echo "{$c->d} => {$x}\n";
! 25: }
! 26:
! 27: ?>
! 28: --EXPECT--
! 29: 1 => a
! 30: 2 => b
! 31: 3 => c
! 32: 1 => a
! 33: 2 => b
! 34: 3 => c
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>