3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime; $departure = (new DateTime)->modify('+42 hours'); echo $now->format('Y-m-d H:i:s') . PHP_EOL; echo $departure->format('Y-m-d H:i:s') . PHP_EOL; echo $now->diff($departure)->format('%h') . PHP_EOL;
based on lDkQl
Output for 5.6.28, 7.0.20 - 7.2.0
2016-01-06 12:47:17 2016-01-08 06:47:17 18
Output for 7.0.6
2016-05-21 13:24:30 2016-05-23 07:24:30 18
Output for 7.0.5
2016-04-03 09:26:14 2016-04-05 03:26:14 18
Output for 7.0.4
2016-03-10 21:32:44 2016-03-12 15:32:44 18
Output for 7.0.3
2016-03-18 22:56:59 2016-03-20 16:56:59 18
Output for 7.0.2
2016-03-23 05:10:13 2016-03-24 23:10:13 18
Output for 7.0.1
2016-03-24 08:17:11 2016-03-26 02:17:11 18
Output for 7.0.0
2016-03-27 10:10:30 2016-03-29 04:10:30 18
Output for 5.6.21
2016-05-02 16:19:17 2016-05-04 10:19:17 18
Output for 5.6.20
2016-04-10 08:28:07 2016-04-12 02:28:07 18
Output for 5.6.19
2016-03-08 05:41:05 2016-03-09 23:41:05 18
Output for 5.6.18
2016-03-15 14:38:07 2016-03-17 08:38:07 18
Output for 5.6.17
2016-03-20 02:10:35 2016-03-21 20:10:35 18
Output for 5.6.16
2016-03-28 10:59:45 2016-03-30 04:59:45 18
Output for 5.6.15
2016-03-29 11:49:04 2016-03-31 05:49:04 18
Output for 5.6.14
2016-04-14 17:31:37 2016-04-16 11:31:37 18
Output for 5.6.13
2016-04-15 18:10:39 2016-04-17 12:10:39 18
Output for 5.6.12
2016-04-20 08:39:48 2016-04-22 02:39:48 18
Output for 5.6.11
2016-04-24 15:05:57 2016-04-26 09:05:57 18
Output for 5.6.10
2016-04-25 17:11:45 2016-04-27 11:11:45 18
Output for 5.6.9
2016-04-27 22:37:49 2016-04-29 16:37:49 18
Output for 5.6.8
2016-04-30 07:07:53 2016-05-02 01:07:53 18
Output for 5.5.35
2016-05-23 02:18:24 2016-05-24 20:18:24 18
Output for 5.5.34
2016-04-11 10:42:00 2016-04-13 04:42:00 18
Output for 5.5.33
2016-03-09 08:39:55 2016-03-11 02:39:55 18
Output for 5.5.32
2016-03-17 18:34:54 2016-03-19 12:34:54 18
Output for 5.5.31
2016-03-21 05:19:31 2016-03-22 23:19:31 18
Output for 5.5.30
2016-04-01 13:41:08 2016-04-03 07:41:08 18
Output for 5.5.29
2016-04-17 08:28:28 2016-04-19 02:28:28 18
Output for 5.5.28
2016-04-21 11:58:20 2016-04-23 05:58:20 18
Output for 5.5.27
2016-04-22 13:36:49 2016-04-24 07:36:49 18
Output for 5.5.26
2016-04-26 19:52:18 2016-04-28 13:52:18 18
Output for 5.5.25
2016-04-29 03:17:57 2016-04-30 21:17:57 18
Output for 5.5.24
2016-05-24 09:41:06 2016-05-26 03:41:06 18
Output for 5.4.45
2016-01-06 12:47:20 2016-01-08 06:47:20 18
Output for 5.4.44
2016-01-06 12:47:21 2016-01-08 06:47:21 18
Output for 5.4.43
2016-01-06 12:47:22 2016-01-08 06:47:22 18
Output for 5.4.41 - 5.4.42
2016-01-06 12:47:23 2016-01-08 06:47:23 18
Output for 5.4.40
2016-01-06 12:47:24 2016-01-08 06:47:24 18
Output for 5.4.38 - 5.4.39
2016-01-06 12:47:25 2016-01-08 06:47:25 18
Output for 5.4.36 - 5.4.37
2016-01-06 12:47:26 2016-01-08 06:47:26 18
Output for 5.4.34 - 5.4.35
2016-01-06 12:47:27 2016-01-08 06:47:27 18
Output for 5.4.31 - 5.4.32
2016-01-06 12:47:28 2016-01-08 06:47:28 18
Output for 5.4.27 - 5.4.30
2016-01-06 12:47:29 2016-01-08 06:47:29 18
Output for 5.4.24 - 5.4.26
2016-01-06 12:47:30 2016-01-08 06:47:30 18
Output for 5.4.21 - 5.4.23
2016-01-06 12:47:31 2016-01-08 06:47:31 18
Output for 5.4.18 - 5.4.20
2016-01-06 12:47:32 2016-01-08 06:47:32 18
Output for 5.4.15 - 5.4.17
2016-01-06 12:47:33 2016-01-08 06:47:33 18
Output for 5.4.12 - 5.4.14
2016-01-06 12:47:34 2016-01-08 06:47:34 18
Output for 5.4.11
2016-01-06 12:47:35 2016-01-08 06:47:35 18
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/i9aen on line 3
Process exited with code 255.