3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fact(x) { if (x == 0 || x == 1) { return x; } else { return x * (fact(x)); } } echo fact(3);
Output for 5.6.7 - 5.6.13
Parse error: syntax error, unexpected ')', expecting variable (T_VARIABLE) in /in/fIgsc on line 3
Process exited with code 255.
Output for 5.4.8 - 5.4.45, 5.5.24 - 5.5.29
Parse error: syntax error, unexpected ')', expecting '&' or variable (T_VARIABLE) in /in/fIgsc on line 3
Process exited with code 255.

preferences:
171.93 ms | 1395 KiB | 57 Q