3v4l.org

run code in 300+ PHP versions simultaneously
<?php $week = new \DateTime(strtotime("+1 week")); $halfmonth = strtotime("+2 weeks"); var_dump($week < $halfmonth); var_dump($halfmonth); var_dump($week); var_dump($week < $halfmonth);
Output for 8.3.0 - 8.3.6
Fatal error: Uncaught DateMalformedStringException: Failed to parse time string (1413902998) at position 8 (9): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413902998') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Fatal error: Uncaught Exception: Failed to parse time string (1413902998) at position 8 (9): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413902998') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.14 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1413902998) at position 8 (9): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413902998') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.6
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1462844307) at position 8 (0): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462844307') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.5
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1460213463) at position 7 (4): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1460213463') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.4
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1458178254) at position 7 (2): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1458178254') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.3
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1458870240) at position 8 (4): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1458870240') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.2
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1459163841) at position 7 (8): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1459163841') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.1
Fatal error: Uncaught Exception: DateTime::__construct(): Failed to parse time string (1459337400) at position 7 (4): Unexpected character in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1459337400') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 7.0.0
Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 6 bool(true) int(1460209954) object(DateTime)#1 (3) { ["date"]=> string(26) "5154-03-26 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 11 bool(true)
Output for 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413902998) at position 8 (9): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413902998') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462740118) at position 8 (1): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462740118') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1460801109) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1460801109') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.19
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1457914509) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1457914509') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.18
Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 6 bool(true) int(1459163388) object(DateTime)#1 (3) { ["date"]=> string(26) "2188-03-14 14:58:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 11 bool(true)
Output for 5.6.17
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1458972790) at position 8 (9): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1458972790') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.16
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1459697931) at position 8 (3): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1459697931') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.15
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1459787491) at position 8 (9): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1459787491') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.14
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1460142425) at position 7 (4): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1460142425') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.13
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461279865) at position 7 (8): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1461279865') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.12
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461672609) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1461672609') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.11
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461957966) at position 8 (6): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1461957966') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.10
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462136651) at position 7 (6): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462136651') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.9
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462328196) at position 7 (1): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462328196') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.8
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462528766) at position 8 (6): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462528766') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.6.7
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1464730426) at position 8 (2): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1464730426') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.35
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1464480402) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1464480402') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.34
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1460908957) at position 8 (5): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1460908957') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.33
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1458044647) at position 7 (6): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1458044647') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.32
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1458756450) at position 8 (5): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1458756450') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.31
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1459065895) at position 7 (8): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1459065895') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1460053977) at position 7 (9): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1460053977') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.29
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461416735) at position 8 (3): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1461416735') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461770826) at position 8 (2): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1461770826') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.27
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1461866080) at position 8 (8): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1461866080') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.26
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462232025) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462232025') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.25
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462426452) at position 8 (5): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462426452') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.5.24
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1462625997) at position 8 (9): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1462625997') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.45
Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 6 bool(true) int(1444049717) object(DateTime)#1 (3) { ["date"]=> string(26) "4917-09-21 14:43:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 11 bool(true)
Output for 5.4.44
Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 6 bool(true) int(1441005865) object(DateTime)#1 (3) { ["date"]=> string(26) "1065-08-17 14:40:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 11 bool(true)
Output for 5.4.43
Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 6 bool(true) int(1441005861) object(DateTime)#1 (3) { ["date"]=> string(26) "1061-08-17 14:40:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Notice: Object of class DateTime could not be converted to int in /in/GWLg7 on line 11 bool(true)
Output for 5.4.42
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1437024047) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1437024047') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.41
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1437024046) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1437024046') #1 {main} thrown in /in/GWLg7 on line 3
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 (1437024041) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1437024041') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.38
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1437024040) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1437024040') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.37
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1437024038) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1437024038') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.35 - 5.4.36
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1437024037) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1437024037') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.34
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1437024036) at position 7 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1437024036') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.32
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413903003) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413903003') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.4.16 - 5.4.31
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413903004) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413903004') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.3.28 - 5.3.29, 5.4.0 - 5.4.15
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413903005) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413903005') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.3.11 - 5.3.27
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413903006) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413903006') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.10
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413903007) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413903007') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.2.12 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GWLg7 on line 3 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413903007) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413903007') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.2.0 - 5.2.11
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GWLg7 on line 3 Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (1413903008) at position 8 (0): Unexpected character' in /in/GWLg7:3 Stack trace: #0 /in/GWLg7(3): DateTime->__construct('1413903008') #1 {main} thrown in /in/GWLg7 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GWLg7 on line 3 Fatal error: Class 'DateTime' not found in /in/GWLg7 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GWLg7 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/GWLg7 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GWLg7 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/GWLg7 on line 3

preferences:
248.44 ms | 402 KiB | 328 Q