3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name = "Type" //creating a list if (strpos($name, "type")) { $listValue = '1'; } elseif (strpos($name, "colour")) { $listValue = '2'; } else { $listValue = '3'; } echo "I am list" . $listValue; ?>
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected 'if' (T_IF) in /in/I3Tp2 on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_IF in /in/I3Tp2 on line 5
Process exited with code 255.

preferences:
179.1 ms | 1395 KiB | 64 Q