3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (class_exists('DateTime')) { $date = new DateTime('2013-10-31') $date->modify('-1 month'); print "2013-10-31, -1 month: {$date->format('m')}"; $date = new DateTime('2013-10-31') $date->modify('first day of 1 month ago'); print "2013-10-31, first day of 1 month ago: {$date->format('m')}"; } else { print 'Not supported.'; }
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected '$date' (T_VARIABLE) in /in/UZsJY on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/UZsJY on line 5
Process exited with code 255.