3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bar() { echo "bar() called\n"; return 1; } function foo() { static $i = bar(); echo $i++, "\n"; } foo(); foo(); foo();
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.

preferences:
197.69 ms | 940 KiB | 79 Q