3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = new DateTime(); $end = new DateTime('tomorrow'); $timeFrame = ($end->getTimestamp()-$start->getTimestamp())/2; $endTimeSchedule = new DateTime('+'.$timeFrame.'sec'); var_dump($endTimeSchedule);
Output for 7.1.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2013-01-12 17:59:43.006314" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.12 - 7.0.14
object(DateTime)#3 (3) { ["date"]=> string(26) "2013-01-12 17:59:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+29732.5sec) at position 3 (7): Unexpected character in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+29732.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 7.0.5
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-02 22:13:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-10 15:20:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-18 04:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:03" }
Output for 7.0.2
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-22 18:21:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+10780.5sec) at position 4 (8): Unexpected character in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+10780.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 7.0.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-26 21:51:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.12.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-11 01:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+14:08" }
Output for hhvm-3.10.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-30 14:40:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+38198.5sec) at position 3 (1): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+38198.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.6.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+12674.5sec) at position 4 (7): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+12674.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.6.19
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+27298.5sec) at position 3 (2): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+27298.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.6.18
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-14 03:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+04:13" }
Output for 5.6.17
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-19 17:44:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-27 08:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+04:58" }
Output for 5.6.15
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+2974.5sec) at position 3 (7): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+2974.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.6.14
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+41793.5sec) at position 4 (9): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+41793.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.6.13
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-15 14:25:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-19 21:12:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-23 03:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+04:07" }
Output for 5.6.10
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 13:37:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-27 16:06:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-29 20:04:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+31672.5sec) at position 4 (7): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+31672.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.5.34
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-10 02:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+04:13" }
Output for 5.5.33
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 05:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+11:56" }
Output for 5.5.32
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-16 23:49:06.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:29" }
Output for 5.5.31
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-20 06:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+17:48" }
Output for 5.5.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+42548.5sec) at position 4 (4): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+42548.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.5.29
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-16 21:27:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 00:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+04:49" }
Output for 5.5.27
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 23:57:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-26 14:50:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-28 17:51:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+15742.5sec) at position 4 (4): Unexpected character' in /in/CLPkl:7 Stack trace: #0 /in/CLPkl(7): DateTime->__construct('+15742.5sec') #1 {main} thrown in /in/CLPkl on line 7
Process exited with code 255.
Output for 5.4.45
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 04:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:20" }
Output for 5.4.44
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 17:16:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.42 - 5.4.43
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 03:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:20" }
Output for 5.4.40 - 5.4.41
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 17:16:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.37 - 5.4.39
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 02:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:20" }
Output for 5.4.35 - 5.4.36
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 17:16:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.32 - 5.4.34
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 01:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:20" }
Output for 5.4.30 - 5.4.31
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-02-21 17:16:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29, 5.4.29
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 17:16:39" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.26 - 5.4.28
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 00:05:00" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:20" }
Output for 5.3.28, 5.4.23 - 5.4.25
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 17:16:40" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.19 - 5.4.22
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 09:05:00" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:19" }
Output for 5.3.27, 5.4.16 - 5.4.18
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 17:16:41" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.24 - 5.3.26, 5.4.13 - 5.4.15
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 08:05:00" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:19" }
Output for 5.3.20 - 5.3.23, 5.4.9 - 5.4.12
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 17:16:42" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.15 - 5.3.19, 5.4.6 - 5.4.8
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 07:05:00" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:19" }
Output for 5.3.12 - 5.3.14, 5.4.2 - 5.4.5
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 17:16:43" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.7 - 5.3.11, 5.4.0 - 5.4.1
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 06:05:00" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:19" }
Output for 5.3.3 - 5.3.6
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 17:16:44" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.2
object(DateTime)#3 (3) { ["date"]=> string(19) "2016-02-21 05:05:00" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:19" }
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/CLPkl on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/CLPkl 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/CLPkl 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/CLPkl on line 2