3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $week = new DateTime("Y-m-d", strtotime("+1 week")); $halfmonth = strtotime("+2 weeks"); var_dump($week < $halfmonth); var_dump($halfmonth); var_dump($week); var_dump($week < $halfmonth);
based on Aer9E
Output for 7.0.14 - 7.1.0
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1413903166) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.7
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1413910366) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.6
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462828895) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.5
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1460199337) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.4
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1458161082) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.3
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1458853743) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.2
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1459148045) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.1
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1459319554) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 7.0.0
Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1459590358) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'Exception' with message '__construct() expects parameter 2 to be object, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct() #1 {main}
Process exited with code 255.
Output for 5.6.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1413903166) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.21
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462724773) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1460787297) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.19
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1457890943) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.18
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1458540565) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.17
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1458956562) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.16
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1459682899) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.15
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1459772306) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.14
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1460128335) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.13
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1461265733) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.12
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1461658087) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.11
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1461943772) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.10
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462122416) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.9
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462312971) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.8
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462513315) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.6.7
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1464707577) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.35
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1464463990) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.34
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1460893152) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.33
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1458028373) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.32
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1458665909) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.31
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1459050024) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1460039468) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.29
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1461401927) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.28
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1461755476) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.27
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1461851941) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.26
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462216768) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.25
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462411411) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.5.24
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1462612182) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.45
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491781) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.44
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491782) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.43
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491783) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.41 - 5.4.42
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491784) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.40
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491785) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.38 - 5.4.39
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491786) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.36 - 5.4.37
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491787) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.34 - 5.4.35
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491788) #1 {main} thrown in /in/kA99D on line 3
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() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491789) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.27 - 5.4.30
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491790) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.24 - 5.4.26
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491791) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.3.28, 5.4.21 - 5.4.23
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491792) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.4.19 - 5.4.20
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491793) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.3.26 - 5.3.27, 5.4.17 - 5.4.18
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491794) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.3.23 - 5.3.25, 5.4.13 - 5.4.16
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491795) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.3.20 - 5.3.22, 5.4.9 - 5.4.12
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491796) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.3.16 - 5.3.19, 5.4.6 - 5.4.8
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491797) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.3.12 - 5.3.15, 5.4.3 - 5.4.5
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491798) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.3.8 - 5.3.11, 5.4.0 - 5.4.2
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491799) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.2.15 - 5.2.17, 5.3.4 - 5.3.7
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491800) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.2.11 - 5.2.14, 5.3.0 - 5.3.3
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491801) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.2.3 - 5.2.10
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491802) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.2.1 - 5.2.2
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given' in /in/kA99D:3 Stack trace: #0 /in/kA99D(3): DateTime->__construct('Y-m-d', 1448491803) #1 {main} thrown in /in/kA99D on line 3
Process exited with code 255.
Output for 5.2.0
Warning: DateTime::__construct() expects parameter 2 to be DateTimeZone, integer given in /in/kA99D on line 3 Notice: Object of class DateTime could not be converted to int in /in/kA99D on line 6 bool(true) int(1449096603) object(DateTime)#1 (0) { } Notice: Object of class DateTime could not be converted to int in /in/kA99D on line 11 bool(true)
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/kA99D on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/kA99D on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/kA99D on line 3