3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $b = new DateTime('2014-08-21 15:38:16'); $a = new DateTime('-1 hour'); if($b < $a) { echo 'expired'; } echo $b->format('c') . PHP_EOL; echo $a->format('c');
based on AYq69
Output for 5.6.28, 7.0.14 - 7.1.0
expired2014-08-21T15:38:16+02:00 2014-08-21T15:39:28+02:00
Output for 7.0.6
expired2014-08-21T15:38:16+02:00 2016-05-03T08:53:20+02:00
Output for 7.0.5
expired2014-08-21T15:38:16+02:00 2016-04-02T21:44:01+02:00
Output for 7.0.4
expired2014-08-21T15:38:16+02:00 2016-03-10T08:17:27+01:00
Output for 7.0.3
expired2014-08-21T15:38:16+02:00 2016-03-18T08:55:17+01:00
Output for 7.0.2
expired2014-08-21T15:38:16+02:00 2016-03-22T14:48:50+01:00
Output for 7.0.1
expired2014-08-21T15:38:16+02:00 2016-03-23T19:32:57+01:00
Output for 7.0.0
expired2014-08-21T15:38:16+02:00 2016-03-26T21:05:42+01:00
Output for hhvm-3.12.0
expired2014-08-21T15:38:16+02:00 2016-03-12T11:05:12+01:00
Output for hhvm-3.10.0
expired2014-08-21T15:38:16+02:00 2016-03-30T10:27:46+02:00
Output for 5.6.21
expired2014-08-21T15:38:16+02:00 2016-05-02T04:14:07+02:00
Output for 5.6.20
expired2014-08-21T15:38:16+02:00 2016-04-09T20:40:52+02:00
Output for 5.6.19
expired2014-08-21T15:38:16+02:00 2016-03-07T16:25:15+01:00
Output for 5.6.18
expired2014-08-21T15:38:16+02:00 2016-03-15T00:22:08+01:00
Output for 5.6.17
expired2014-08-21T15:38:16+02:00 2016-03-19T13:10:11+01:00
Output for 5.6.16
expired2014-08-21T15:38:16+02:00 2016-03-27T22:50:48+02:00
Output for 5.6.15
expired2014-08-21T15:38:16+02:00 2016-03-28T23:56:04+02:00
Output for 5.6.14
expired2014-08-21T15:38:16+02:00 2016-04-02T02:16:53+02:00
Output for 5.6.13
expired2014-08-21T15:38:16+02:00 2016-04-15T06:11:36+02:00
Output for 5.6.12
expired2014-08-21T15:38:16+02:00 2016-04-19T19:56:19+02:00
Output for 5.6.11
expired2014-08-21T15:38:16+02:00 2016-04-23T03:00:05+02:00
Output for 5.6.10
expired2014-08-21T15:38:16+02:00 2016-04-25T04:44:08+02:00
Output for 5.6.9
expired2014-08-21T15:38:16+02:00 2016-04-27T09:42:00+02:00
Output for 5.6.8
expired2014-08-21T15:38:16+02:00 2016-04-29T17:48:46+02:00
Output for 5.5.35
expired2014-08-21T15:38:16+02:00 2016-05-22T07:58:07+02:00
Output for 5.5.34
expired2014-08-21T15:38:16+02:00 2016-04-10T23:01:16+02:00
Output for 5.5.33
expired2014-08-21T15:38:16+02:00 2016-03-08T19:22:25+01:00
Output for 5.5.32
expired2014-08-21T15:38:16+02:00 2016-03-17T02:03:20+01:00
Output for 5.5.31
expired2014-08-21T15:38:16+02:00 2016-03-20T15:56:01+01:00
Output for 5.5.30
expired2014-08-21T15:38:16+02:00 2016-04-01T01:51:55+02:00
Output for 5.5.29
expired2014-08-21T15:38:16+02:00 2016-04-16T20:16:50+02:00
Output for 5.5.28
expired2014-08-21T15:38:16+02:00 2016-04-20T23:02:21+02:00
Output for 5.5.27
expired2014-08-21T15:38:16+02:00 2016-04-22T01:31:08+02:00
Output for 5.5.26
expired2014-08-21T15:38:16+02:00 2016-04-26T07:11:05+02:00
Output for 5.5.25
expired2014-08-21T15:38:16+02:00 2016-04-28T13:29:03+02:00
Output for 5.5.24
expired2014-08-21T15:38:16+02:00 2016-05-23T20:50:04+02:00
Output for 5.4.45
expired2014-08-21T15:38:16+02:00 2015-09-21T11:42:05+02:00
Output for 5.4.44
expired2014-08-21T15:38:16+02:00 2015-09-21T11:42:01+02:00
Output for 5.4.43
expired2014-08-21T15:38:16+02:00 2015-09-21T11:41:55+02:00
Output for 5.4.42
expired2014-08-21T15:38:16+02:00 2015-09-21T11:41:53+02:00
Output for 5.4.41
expired2014-08-21T15:38:16+02:00 2015-09-21T11:41:49+02:00
Output for 5.4.40
expired2014-08-21T15:38:16+02:00 2015-09-21T11:41:44+02:00
Output for 5.4.39
expired2014-08-21T15:38:16+02:00 2015-09-21T11:41:41+02:00
Output for 5.4.38
expired2014-08-21T15:38:16+02:00 2015-03-13T22:12:49+01:00
Output for 5.4.35 - 5.4.37
expired2014-08-21T15:38:16+02:00 2015-03-13T22:12:42+01:00
Output for 5.4.34
expired2014-08-21T15:38:16+02:00 2015-03-13T22:12:41+01:00
Output for 5.4.32
expired2014-08-21T15:38:16+02:00 2014-08-28T12:14:53+02:00
Output for 5.4.15 - 5.4.31
expired2014-08-21T15:38:16+02:00 2014-08-21T15:39:32+02:00
Output for 5.3.23 - 5.3.28, 5.4.0 - 5.4.14
expired2014-08-21T15:38:16+02:00 2014-08-21T15:39:33+02:00
Output for 5.3.29
expired2014-08-21T15:38:16+02:00 2014-08-28T12:14:52+02:00
Output for 5.3.2 - 5.3.22
expired2014-08-21T15:38:16+02:00 2014-08-21T15:39:34+02:00
Output for 5.2.2 - 5.3.1
expired2014-08-21T15:38:16+02:00 2014-08-21T15:39:35+02:00
Output for 5.2.0 - 5.2.1
2014-08-21T15:38:16+02:00 2014-08-21T15:39:35+02:00
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/jodD4 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/jodD4 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/jodD4 on line 2