3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new \DateTime(); try { $date->modify('sda'); } catch ($e) { echo "Oops!"; } echo $date->format('Y-m-d H:i:s');
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17, 7.0.0 - 7.0.2
Parse error: syntax error, unexpected '$e' (T_VARIABLE), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/lVuW6 on line 7
Process exited with code 255.

preferences:
166.37 ms | 1396 KiB | 28 Q