3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $left = 4; $right = '4'; function it($m,$p){echo "\033[".($p?"32m✔":"31m✘")." It $m\033[0m\n"; if(!$p)$GLOBALS['f']=1;}function done({if(@$GLOBALS['f'])die(1);} it($left == $right, "should compare simple values as equal"); it(! $left === $right, "should not compare with identity between ints and strings"); it($left === (int) $right, "should compare if you typecast a string to int"); it((string) $left === $right, "should compare if you typecast an int to a string");
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '{', expecting '&' or variable (T_VARIABLE) in /in/Rhpg8 on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '{', expecting '&' or T_VARIABLE in /in/Rhpg8 on line 6
Process exited with code 255.