mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
24 lines
332 B
PHP
Executable File
24 lines
332 B
PHP
Executable File
--TEST--
|
|
Bug #37046 (foreach breaks static scope)
|
|
--FILE--
|
|
<?php
|
|
function s() {
|
|
static $storage = array(array('x', 'y'));
|
|
return $storage[0];
|
|
}
|
|
|
|
foreach (s() as $k => $function) {
|
|
echo "op1 $k\n";
|
|
if ($k == 0) {
|
|
foreach (s() as $k => $function) {
|
|
echo "op2 $k\n";
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
op1 0
|
|
op2 0
|
|
op2 1
|
|
op1 1
|