3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php f(); if (true) { function f() { echo 1; } } else { function f() { echo 2; } } function f() { echo 3; }
based on N3G3L
Output for 4.3.2 - 5.6.28, 7.0.0 - 7.1.0
3 Fatal error: Cannot redeclare f() (previously declared in /in/s2OZL:4) in /in/s2OZL on line 3
Process exited with code 255.
Output for hhvm-3.12.0
3 Fatal error: Function already defined: f in /in/s2OZL on line 3
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.3.1
3 Fatal error: Cannot redeclare f() (previously declared in /in/s2OZL:4) in /in/s2OZL on line 3