3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function name() { echo "name function\n"; } $x = 0; while ($x < 5) { function name() { echo "name function\n"; } name(); $x++; }
Output for 4.3.2 - 5.6.28, 7.0.0 - 7.1.0
Fatal error: Cannot redeclare name() (previously declared in /in/8gDbZ:4) in /in/8gDbZ on line 10
Process exited with code 255.
Output for hhvm-3.12.0
Fatal error: Function already defined: name in /in/8gDbZ on line 13
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot redeclare name() (previously declared in /in/8gDbZ:4) in /in/8gDbZ on line 10