3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $expires_at = DateTime::createFromFormat("Y-m-d H:i:s", "2014-08-14 13:22:22.000000"); $now = new DateTime(); $now->diff($expires_at); echo ( $now->format("Y-m-d H:i:s") );
based on 0KLJl
Output for 5.6.28, 7.0.14 - 7.1.0
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2014-09-17 12:29:14
Output for 7.0.6
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-05-03 10:07:14
Output for 7.0.5
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-02 22:55:19
Output for 7.0.4
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-10 09:30:12
Output for 7.0.3
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-18 10:08:56
Output for 7.0.2
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-22 16:02:03
Output for 7.0.1
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-23 20:44:53
Output for 7.0.0
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-26 22:17:22
Output for 5.6.21
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-05-02 05:27:09
Output for 5.6.20
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-09 21:52:54
Output for 5.6.19
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-07 17:37:53
Output for 5.6.18
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-15 01:41:46
Output for 5.6.17
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-19 14:23:11
Output for 5.6.16
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-28 00:04:19
Output for 5.6.15
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-29 01:09:22
Output for 5.6.14
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-02 03:29:00
Output for 5.6.13
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-15 07:23:09
Output for 5.6.12
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-19 21:10:02
Output for 5.6.11
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-23 04:13:00
Output for 5.6.10
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-25 05:56:38
Output for 5.6.9
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-27 10:54:33
Output for 5.6.8
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-29 19:03:56
Output for 5.5.35
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-05-22 09:14:33
Output for 5.5.34
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-11 00:13:54
Output for 5.5.33
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-08 20:34:48
Output for 5.5.32
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-17 03:16:51
Output for 5.5.31
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-03-20 17:08:54
Output for 5.5.30
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-01 03:06:02
Output for 5.5.29
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-16 21:29:33
Output for 5.5.28
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-21 00:16:35
Output for 5.5.27
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-22 02:43:43
Output for 5.5.26
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-26 08:23:33
Output for 5.5.25
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-04-28 14:41:43
Output for 5.5.24
Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, boolean given in /in/XQS6o on line 4 2016-05-23 22:02:44
Output for 5.4.45
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-09-21 13:50:25
Output for 5.4.44
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-09-21 13:50:19
Output for 5.4.43
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-09-21 13:50:13
Output for 5.4.42
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-09-21 13:50:11
Output for 5.4.41
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-09-21 13:50:08
Output for 5.4.40
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-09-21 13:50:06
Output for 5.4.39
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-09-21 13:50:03
Output for 5.4.38
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-03-14 20:11:34
Output for 5.4.37
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-03-14 20:11:27
Output for 5.4.35 - 5.4.36
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-03-14 20:11:26
Output for 5.4.34
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2015-03-14 20:11:25
Output for 5.4.18 - 5.4.32
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2014-09-17 12:29:18
Output for 5.3.25 - 5.4.17
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2014-09-17 12:29:19
Output for 5.3.3 - 5.3.24
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2014-09-17 12:29:20
Output for 5.3.0 - 5.3.2
Warning: DateTime::diff() expects parameter 1 to be DateTime, boolean given in /in/XQS6o on line 4 2014-09-17 12:29:21
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/XQS6o on line 2
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/XQS6o on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/XQS6o on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Undefined class name 'datetime' in /in/XQS6o on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Undefined class name 'datetime' in /in/XQS6o on line 2