3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = true; if ($a > $b): echo $a." is greater than ".$b; else if ($a == $b): // Will not compile. echo "The above line causes a parse error."; endif;
based on 7DhDj
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.7
Parse error: syntax error, unexpected 'if' (T_IF), expecting ':' in /in/NMgCB on line 7
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: b in /in/NMgCB on line 5 Notice: Undefined variable: a in /in/NMgCB on line 5 Notice: Undefined variable: b in /in/NMgCB on line 7 Notice: Undefined variable: a in /in/NMgCB on line 7 The above line causes a parse error.