- Output for 8.3.0
- bar() called 1 2 3
- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.26, 8.2.0 - 8.2.13
- Fatal error: Constant expression contains invalid operations in /in/bAFd9 on line 9
Process exited with code 255.
<?php
function bar() {
echo "bar() called\n";
return 1;
}
function foo() {
static $i = bar();
echo $i++, "\n";
}
foo();
foo();
foo();