3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(time()); $time_start = new DateTime('2014-10-02'); echo $time_start->format('r') . "\n"; $time_start->modify('first day of this month'); echo $time_start->format('r') . "\n"; $time_start->setTimestamp(time()); echo $time_start->format('r') . "\n";
based on 0ukZ4
Output for 5.6.19 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.4 - 7.1.0
int(1412768635) Thu, 02 Oct 2014 00:00:00 +0200 Wed, 01 Oct 2014 00:00:00 +0200 Wed, 08 Oct 2014 13:43:55 +0200
Output for 5.3.0 - 5.6.18, 7.0.0 - 7.0.3
int(1412768635) Thu, 02 Oct 2014 00:00:00 +0200 Wed, 01 Oct 2014 00:00:00 +0200 Wed, 01 Oct 2014 13:43:55 +0200
Output for 5.2.13 - 5.2.17
int(1412768635) Thu, 02 Oct 2014 00:00:00 +0200 Warning: DateTime::modify(): Failed to parse time string (first day of this month) at position 10 (o): The timezone could not be found in the database in /in/5S9V2 on line 7 Thu, 02 Oct 2014 00:00:00 +0200 Fatal error: Call to undefined method DateTime::setTimestamp() in /in/5S9V2 on line 11
Process exited with code 255.
Output for 5.2.0 - 5.2.12
int(1412768635) Thu, 02 Oct 2014 00:00:00 +0200 Fri, 03 Oct 2014 00:00:00 +0200 Fatal error: Call to undefined method DateTime::setTimestamp() in /in/5S9V2 on line 11
Process exited with code 255.
Output for 5.0.0 - 5.1.6
int(1412768635) Fatal error: Class 'DateTime' not found in /in/5S9V2 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
int(1412768635) Fatal error: Cannot instantiate non-existent class: datetime in /in/5S9V2 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
int(1412768635) Fatal error: Cannot instantiate non-existent class: datetime in /in/5S9V2 on line 3