3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $start = new DateTime(); $end = new DateTime('tomorrow'); $middle = ($end->getTimestamp()-$start->getTimestamp())/2; $final = new DateTime('+'.$middle.'s'); var_dump($final);
Output for 7.0.12 - 7.1.0
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+21917s) at position 4 (1): Unexpected character in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+21917s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 7.0.6
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+41487.5s) at position 4 (8): Unexpected character in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+41487.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 7.0.5
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+17440s) at position 5 (0): Unexpected character in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+17440s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 7.0.4
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+1248.5s) at position 6 (5): Unexpected character in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+1248.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 7.0.3
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+495s) at position 3 (5): Unexpected character in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+495s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 7.0.2
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-21 06:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:43" }
Output for 7.0.1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (+24998s) at position 4 (9): Unexpected character in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+24998s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 7.0.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-26 02:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+19:56" }
Output for 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+21917s) at position 4 (1): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+21917s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+7123s) at position 4 (3): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+7123s') #1 {main} thrown in /in/uCRpt 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 (+25988.5s) at position 4 (8): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+25988.5s') #1 {main} thrown in /in/uCRpt 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 (+5770s) at position 3 (7): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+5770s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.6.18
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+26566s) at position 3 (5): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+26566s') #1 {main} thrown in /in/uCRpt 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 (+35438s) at position 4 (3): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+35438s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
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) "+16:42" }
Output for 5.6.15
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+14658s) at position 4 (5): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+14658s') #1 {main} thrown in /in/uCRpt 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 (+9798.5s) at position 3 (9): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+9798.5s') #1 {main} thrown in /in/uCRpt 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 (+2766.5s) at position 3 (6): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+2766.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.6.12
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-19 07:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+22:42" }
Output for 5.6.11
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-22 08:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+09:29" }
Output for 5.6.10
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+6333s) at position 4 (3): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+6333s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.6.9
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+40376.5s) at position 4 (7): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+40376.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.6.8
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+26750s) at position 3 (7): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+26750s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.6.7
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 04:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+89:00" }
Output for 5.5.35
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+1605.5s) at position 6 (5): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+1605.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.5.34
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+15466s) at position 5 (6): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+15466s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.5.33
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 06:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+24:23" }
Output for 5.5.32
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+8044s) at position 4 (4): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+8044s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.5.31
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-20 15:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+03:02" }
Output for 5.5.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+10944s) at position 4 (4): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+10944s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.5.29
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+20662.5s) at position 4 (6): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+20662.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.5.28
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 15:05:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:07" }
Output for 5.5.27
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+11964.5s) at position 4 (6): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+11964.5s') #1 {main} thrown in /in/uCRpt 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 (+2291s) at position 4 (1): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+2291s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.5.25
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+34483.5s) at position 4 (8): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+34483.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.5.24
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+20745.5s) at position 4 (4): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+20745.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.45
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28219.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28219.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.43 - 5.4.44
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28219s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28219s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.41 - 5.4.42
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28218.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28218.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.39 - 5.4.40
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28218s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28218s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.36 - 5.4.38
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28217.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28217.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.34 - 5.4.35
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28217s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28217s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.29, 5.4.31 - 5.4.32
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28216.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28216.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.28 - 5.4.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28216s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28216s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.25 - 5.4.27
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28215.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28215.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.28, 5.4.21 - 5.4.24
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28215s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28215s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.4.18 - 5.4.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28214.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28214.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.25 - 5.3.27, 5.4.15 - 5.4.17
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28214s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28214s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.21 - 5.3.24, 5.4.11 - 5.4.14
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28213.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28213.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.17 - 5.3.20, 5.4.8 - 5.4.10
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28213s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28213s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.14 - 5.3.16, 5.4.3 - 5.4.7
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28212.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28212.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.10 - 5.3.13, 5.4.0 - 5.4.2
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28212s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28212s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.4 - 5.3.9
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28211.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28211.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.1 - 5.3.3
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28211s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28211s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.3.0
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (+28210.5s) at position 3 (2): Unexpected character' in /in/uCRpt:7 Stack trace: #0 /in/uCRpt(7): DateTime->__construct('+28210.5s') #1 {main} thrown in /in/uCRpt on line 7
Process exited with code 255.
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/uCRpt on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/uCRpt 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/uCRpt 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/uCRpt on line 2