3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Declared unconditionally, so the implementation is bound to the name 'foo' as soon as the file loads. function foo() { echo "foo\n"; } if (true) { // Declared conditionally, so the definition is put into memory, but only "assigned" to the name "bar" here. function bar() { echo "bar\n"; } }
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6

preferences:
120.8 ms | 402 KiB | 121 Q