1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Files
archived-php-src/Zend/tests/static_variables_recursive.phpt
T
2023-05-24 20:17:31 +02:00

30 lines
466 B
PHP

--TEST--
Static variable with recursive initializer
--FILE--
<?php
function foo($i) {
static $a = $i <= 10 ? foo($i + 1) : "Done $i";
var_dump($a);
return $i;
}
foo(0);
foo(5);
?>
--EXPECT--
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"
string(7) "Done 11"