3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (class_exists('DateTime') && method_exists('DateTime', 'modify')) { $d = new DateTime('2014W02'); if (method_exists( echo $d->modify('-1 week')->format('r'), PHP_EOL; }
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ')' in /in/FhiOl on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_ECHO, expecting ')' in /in/FhiOl on line 6
Process exited with code 255.

preferences:
186.09 ms | 1395 KiB | 62 Q