3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function t() { var_dump('foo'); } if (!method_exists('t')) { function t() { var_dump('bar'); } }
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: method_exists() expects exactly 2 parameters, 1 given in /in/JQl8H on line 3 Fatal error: Cannot redeclare t() (previously declared in /in/JQl8H:2) in /in/JQl8H on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: method_exists() expects exactly 2 parameters, 1 given in /in/JQl8H on line 3 Fatal error: Function already defined: t in /in/JQl8H on line 4
Process exited with code 255.
Output for 4.3.2 - 5.2.17
Warning: Wrong parameter count for method_exists() in /in/JQl8H on line 3 Fatal error: Cannot redeclare t() (previously declared in /in/JQl8H:2) in /in/JQl8H on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for method_exists() in /in/JQl8H on line 3 Fatal error: Cannot redeclare t() (previously declared in /in/JQl8H:2) in /in/JQl8H on line 4