Annotation of embedaddon/php/Zend/tests/bug37046.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #37046 (foreach breaks static scope)
! 3: --FILE--
! 4: <?php
! 5: function s() {
! 6: static $storage = array(array('x', 'y'));
! 7: return $storage[0];
! 8: }
! 9:
! 10: foreach (s() as $k => $function) {
! 11: echo "op1 $k\n";
! 12: if ($k == 0) {
! 13: foreach (s() as $k => $function) {
! 14: echo "op2 $k\n";
! 15: }
! 16: }
! 17: }
! 18: ?>
! 19: --EXPECT--
! 20: op1 0
! 21: op2 0
! 22: op2 1
! 23: op1 1
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>