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.' seconds'); var_dump($endTimeSchedule);
Output for 7.1.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2013-01-12 18:00:18.006222" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28, 7.0.14
object(DateTime)#3 (3) { ["date"]=> string(26) "2013-01-12 18:00:18.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 (+16263.5 seconds) at position 15 (s): Double timezone specification in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+16263.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 7.0.5
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-03 13:47:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+16351.5 seconds) at position 15 (s): Double timezone specification in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+16351.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 7.0.3
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+15198.5 seconds) at position 15 (s): Double timezone specification in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+15198.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 7.0.2
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+4218.5 seconds) at position 14 (s): Double timezone specification in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+4218.5 seconds') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 7.0.1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+39424.5 seconds) at position 3 (4): Unexpected character in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+39424.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 7.0.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+35847.5 seconds) at position 4 (4): Unexpected character in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+35847.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.21
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-02 17:05:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+38656.5 seconds) at position 3 (6): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+38656.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.19
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-07 23:19:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+29694.5 seconds) at position 3 (6): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+29694.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.17
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+8120.5 seconds) at position 14 (s): Double timezone specification' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+8120.5 seconds') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.16
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-28 14:26:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+32781.5 seconds) at position 4 (8): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+32781.5 second...') #1 {main} thrown in /in/Ve7d4 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 (+29090.5 seconds) at position 3 (0): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+29090.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.13
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+21580.5 seconds) at position 15 (s): Double timezone specification' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+21580.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.12
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 13:10:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+27124.5 seconds) at position 3 (1): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+27124.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.10
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 17:23:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+14609.5 seconds) at position 15 (s): Double timezone specification' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+14609.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.6.8
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-30 12:04:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-22 19:09:37.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+34587.5 seconds) at position 4 (8): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+34587.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.5.33
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-09 12:52:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+23430.5 seconds) at position 15 (s): Double timezone specification' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+23430.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.5.31
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+3171.5 seconds) at position 14 (s): Double timezone specification' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+3171.5 seconds') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.5.30
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-01 15:50:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-17 13:09:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 14:45:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+29595.5 seconds) at position 3 (5): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+29595.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.5.26
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+19019.5 seconds) at position 15 (s): Double timezone specification' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+19019.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.5.25
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-28 21:57:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 20:01:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.45
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36757.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36757.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.4.44
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-19 13:47:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.43
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36756.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36756.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.4.41 - 5.4.42
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-19 13:47:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.39 - 5.4.40
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36755.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36755.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.4.37 - 5.4.38
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-19 13:47:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.35 - 5.4.36
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36754.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36754.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.4.32 - 5.4.34
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-19 13:47:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.29, 5.4.29 - 5.4.31
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36753.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36753.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.4.26 - 5.4.28
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-19 13:47:27" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.23 - 5.4.25
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36752.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36752.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.3.28, 5.4.20 - 5.4.22
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-19 13:47:28" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.27, 5.4.17 - 5.4.19
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36751.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36751.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.3.24 - 5.3.26, 5.4.14 - 5.4.16
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-19 13:47:29" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.20 - 5.3.23, 5.4.11 - 5.4.13
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36750.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36750.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.3.17 - 5.3.19, 5.4.7 - 5.4.10
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-19 13:47:30" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.14 - 5.3.16, 5.4.4 - 5.4.6
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36749.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36749.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.3.9 - 5.3.13, 5.4.0 - 5.4.3
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-19 13:47:31" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.4 - 5.3.8
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+36748.5 seconds) at position 3 (7): Unexpected character' in /in/Ve7d4:7 Stack trace: #0 /in/Ve7d4(7): DateTime->__construct('+36748.5 second...') #1 {main} thrown in /in/Ve7d4 on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.3
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-19 13:47:32" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/Ve7d4 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Ve7d4 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/Ve7d4 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/Ve7d4 on line 2