3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(1 + 1); var_dump(1.5 + 1.5); var_dump(1 + 1.5); var_dump("1" + 1.5); var_dump("1.2" + 1.5); var_dump(false + true); var_dump(["1"] + [1.5]);
Output for 5.4.0 - 7.2.6
int(2) float(3) float(2.5) float(2.5) float(2.7) int(1) array(1) { [0]=> string(1) "1" }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/LY2b5 on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[', expecting ')' in /in/LY2b5 on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/LY2b5 on line 9
Process exited with code 255.