3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $todayStart = new \DateTime('today 0:00'); $todayStart->setTimezone(new \DateTimeZone('PST')); $todayEnd = new \DateTime('tomorrow 0:00'); $todayEnd->setTimezone(new \DateTimeZone('PST')); var_dump([$todayStart, $todayEnd]);
Output for 5.6.28, 7.0.14 - 7.1.0
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2014-03-04 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2014-03-05 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 7.0.6
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-03 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 7.0.5
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-01 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-02 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 7.0.4
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-09 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-10 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 7.0.3
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-17 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-18 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 7.0.2
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-20 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-21 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 7.0.1
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-22 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-23 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 7.0.0
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-25 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-26 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for hhvm-3.12.0
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-28 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for hhvm-3.10.0
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-28 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-29 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.6.21
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-01 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.20
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-08 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-09 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.19
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-06 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-07 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.18
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-13 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-14 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.17
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-18 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-19 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.16
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-26 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-27 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.15
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-28 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.14
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-31 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-01 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.13
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-15 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.12
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-18 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-19 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.11
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-21 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-22 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.10
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-23 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-24 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.9
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-26 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-27 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.6.8
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-28 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-29 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.35
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-21 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-05-22 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.34
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-09 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-10 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.33
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-07 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-08 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.32
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-15 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-16 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.31
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-19 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-20 15:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.30
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-30 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-03-31 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.29
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-15 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-16 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.28
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-19 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-20 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.27
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-21 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.26
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-25 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-26 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.25
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-27 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-28 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.5.24
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-29 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2016-04-30 14:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "PST" } }
Output for 5.4.41 - 5.4.45
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2015-09-13 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2015-09-14 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.4.39 - 5.4.40
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2015-05-09 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2015-05-10 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.4.38
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2015-03-01 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2015-03-02 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.4.34 - 5.4.37
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2015-02-07 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2015-02-08 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.4.30 - 5.4.32
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(26) "2014-09-06 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2014-09-07 15:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.4.26 - 5.4.29
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(19) "2014-09-06 15:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(19) "2014-09-07 15:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.4.0 - 5.4.25
array(2) { [0]=> object(DateTime)#1 (3) { ["date"]=> string(19) "2014-03-04 15:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } [1]=> object(DateTime)#2 (3) { ["date"]=> string(19) "2014-03-05 15:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(19) "America/Los_Angeles" } }
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/G8DaR on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 5 Parse error: syntax error, unexpected '[', expecting ')' in /in/G8DaR on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 5 Parse error: parse error, unexpected '[', expecting ')' in /in/G8DaR on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 4 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/G8DaR on line 5 Parse error: parse error, expecting `')'' in /in/G8DaR on line 6
Process exited with code 255.