3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? $n = 123; if ($n == 1) $return = 1; elseif ($n > 1 && $n <= 1.5) $return = 1.5; elseif ($n < 2 && $n > 1.5) $return = 2; else throw new Exception('wrong number'); echo $return;<?php
Output for 5.4.0 - 5.5.6
Parse error: syntax error, unexpected '<' in /in/f1j6b on line 12
Process exited with code 255.
Output for 4.3.0 - 5.3.29
<? $n = 123; if ($n == 1) $return = 1; elseif ($n > 1 && $n <= 1.5) $return = 1.5; elseif ($n < 2 && $n > 1.5) $return = 2; else throw new Exception('wrong number'); echo $return;<?php