3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $midnight = new \DateTime(); //$midnight->setTime(0, 0); var_dump((string) $midnight->setTime(0, 0, 0)->format(\DateTime::ATOM));
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.30, 5.6.28, 7.0.14 - 7.1.0
string(25) "2014-07-16T00:00:00+02:00"
Output for 7.0.6
string(25) "2016-05-03T00:00:00+02:00"
Output for 7.0.5
string(25) "2016-04-02T00:00:00+02:00"
Output for 7.0.4
string(25) "2016-03-10T00:00:00+01:00"
Output for 7.0.3
string(25) "2016-03-18T00:00:00+01:00"
Output for 7.0.2
string(25) "2016-03-21T00:00:00+01:00"
Output for 7.0.1
string(25) "2016-03-23T00:00:00+01:00"
Output for 7.0.0
string(25) "2016-03-26T00:00:00+01:00"
Output for hhvm-3.12.0
string(25) "2016-03-11T00:00:00+01:00"
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
string(25) "2016-05-02T00:00:00+02:00"
Output for 5.6.20
string(25) "2016-04-09T00:00:00+02:00"
Output for 5.6.19
string(25) "2016-03-07T00:00:00+01:00"
Output for 5.6.18
string(25) "2016-03-14T00:00:00+01:00"
Output for 5.6.17
string(25) "2016-03-19T00:00:00+01:00"
Output for 5.6.16
string(25) "2016-03-27T00:00:00+01:00"
Output for 5.6.15
string(25) "2016-03-28T00:00:00+02:00"
Output for 5.6.14
string(25) "2016-04-01T00:00:00+02:00"
Output for 5.6.13
string(25) "2016-04-15T00:00:00+02:00"
Output for 5.6.12
string(25) "2016-04-19T00:00:00+02:00"
Output for 5.6.11
string(25) "2016-04-22T00:00:00+02:00"
Output for 5.6.10
string(25) "2016-04-25T00:00:00+02:00"
Output for 5.6.9
string(25) "2016-04-27T00:00:00+02:00"
Output for 5.6.8
string(25) "2016-04-29T00:00:00+02:00"
Output for 5.6.7
string(25) "2016-05-25T00:00:00+02:00"
Output for 5.5.35
string(25) "2016-05-22T00:00:00+02:00"
Output for 5.5.34
string(25) "2016-04-10T00:00:00+02:00"
Output for 5.5.33
string(25) "2016-03-08T00:00:00+01:00"
Output for 5.5.32
string(25) "2016-03-16T00:00:00+01:00"
Output for 5.5.31
string(25) "2016-03-20T00:00:00+01:00"
Output for 5.5.30
string(25) "2016-03-31T00:00:00+02:00"
Output for 5.5.29
string(25) "2016-04-16T00:00:00+02:00"
Output for 5.5.28
string(25) "2016-04-20T00:00:00+02:00"
Output for 5.5.27
string(25) "2016-04-21T00:00:00+02:00"
Output for 5.5.26
string(25) "2016-04-26T00:00:00+02:00"
Output for 5.5.25
string(25) "2016-04-28T00:00:00+02:00"
Output for 5.5.24
string(25) "2016-05-23T00:00:00+02:00"
Output for 5.4.39 - 5.4.45
string(25) "2015-09-21T00:00:00+02:00"
Output for 5.4.34 - 5.4.38
string(25) "2015-03-05T00:00:00+01:00"
Output for 5.3.29, 5.4.31 - 5.4.32
string(25) "2014-09-13T00:00:00+02:00"
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hZ3ZK on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hZ3ZK on line 4 Fatal error: Call to a member function format() on a non-object in /in/hZ3ZK on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hZ3ZK on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hZ3ZK on line 4 Fatal error: Class 'DateTime' not found in /in/hZ3ZK on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hZ3ZK on line 2 Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/hZ3ZK on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hZ3ZK on line 2 Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/hZ3ZK on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/hZ3ZK on line 2 Parse error: parse error in /in/hZ3ZK on line 4
Process exited with code 255.