3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $start_datetime = new DateTime('2014-10-27'); $one_month_ago = clone $start_datetime; $one_month_ago = $one_month_ago->modify('- 1 month'); if ($start_datetime < $one_month_ago){ echo ("More than a month ago..."); } else { echo ("Less than a month ago..."); }
Output for 5.2.0 - 7.3.0rc4
Less than a month ago...
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/auTD4 on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/auTD4 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_VARIABLE in /in/auTD4 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/auTD4 on line 4
Process exited with code 255.