3v4l.org

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