3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 'test'; $return = strpos($a, 't'); echo "0: "; if (0) echo 'true'; else echo 'false'; echo "{$}return: "; if ($return) echo '2'; if ($return === 0) echo '3'; if (strpos($a, 't')) echo '4'; if ($return === false) echo '5'; if (strpos($a, 't') === 0) echo '6'; if (strpos($a, 't') === false) echo '7'; if (strpos($a, 't') === $return) echo '8';
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '}', expecting variable (T_VARIABLE) or '$' in /in/kq6cR on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '}', expecting T_VARIABLE or '$' in /in/kq6cR on line 6
Process exited with code 255.