3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function isMarketOpen($timestamp) { //>Wed 11:32:10 EST //$timezone = new DateTimeZone('EST'); $nowDate = new DateTime((string) $timestamp); $marketCloseTime = new DateTime('17:00:00'); $marketOpenTime = new DateTime('08:00:00'); echo $marketOpenTime->format('r'); echo "\n"; echo $nowDate->format('r'); return ($nowDate > $marketOpenTime && $nowDate < $marketCloseTime); } isMarketOpen('Wed 07:32:10 EST');
based on mEEOK
Output for 5.2.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
Wed, 01 Oct 2014 08:00:00 +0200 Wed, 01 Oct 2014 07:32:10 -0500
Output for 7.0.6
Tue, 03 May 2016 08:00:00 +0200 Wed, 04 May 2016 07:32:10 -0500
Output for 5.6.14, 7.0.5
Sat, 02 Apr 2016 08:00:00 +0200 Wed, 06 Apr 2016 07:32:10 -0500
Output for 7.0.4
Thu, 10 Mar 2016 08:00:00 +0100 Wed, 16 Mar 2016 07:32:10 -0500
Output for 7.0.3
Fri, 18 Mar 2016 08:00:00 +0100 Wed, 23 Mar 2016 07:32:10 -0500
Output for 7.0.2
Tue, 22 Mar 2016 08:00:00 +0100 Wed, 23 Mar 2016 07:32:10 -0500
Output for 7.0.1
Wed, 23 Mar 2016 08:00:00 +0100 Wed, 23 Mar 2016 07:32:10 -0500
Output for 7.0.0
Sat, 26 Mar 2016 08:00:00 +0100 Wed, 30 Mar 2016 07:32:10 -0500
Output for 5.6.21
Mon, 02 May 2016 08:00:00 +0200 Wed, 04 May 2016 07:32:10 -0500
Output for 5.6.20
Sat, 09 Apr 2016 08:00:00 +0200 Wed, 13 Apr 2016 07:32:10 -0500
Output for 5.6.19
Mon, 07 Mar 2016 08:00:00 +0100 Wed, 09 Mar 2016 07:32:10 -0500
Output for 5.6.18
Tue, 15 Mar 2016 08:00:00 +0100 Wed, 16 Mar 2016 07:32:10 -0500
Output for 5.6.17
Sat, 19 Mar 2016 08:00:00 +0100 Wed, 23 Mar 2016 07:32:10 -0500
Output for 5.6.16
Sun, 27 Mar 2016 08:00:00 +0200 Wed, 30 Mar 2016 07:32:10 -0500
Output for 5.6.15
Mon, 28 Mar 2016 08:00:00 +0200 Wed, 30 Mar 2016 07:32:10 -0500
Output for 5.6.13
Fri, 15 Apr 2016 08:00:00 +0200 Wed, 20 Apr 2016 07:32:10 -0500
Output for 5.6.12
Tue, 19 Apr 2016 08:00:00 +0200 Wed, 20 Apr 2016 07:32:10 -0500
Output for 5.6.11
Sat, 23 Apr 2016 08:00:00 +0200 Wed, 27 Apr 2016 07:32:10 -0500
Output for 5.6.10
Mon, 25 Apr 2016 08:00:00 +0200 Wed, 27 Apr 2016 07:32:10 -0500
Output for 5.6.9
Wed, 27 Apr 2016 08:00:00 +0200 Wed, 27 Apr 2016 07:32:10 -0500
Output for 5.6.8
Fri, 29 Apr 2016 08:00:00 +0200 Wed, 04 May 2016 07:32:10 -0500
Output for 5.6.7
Wed, 25 May 2016 08:00:00 +0200 Wed, 25 May 2016 07:32:10 -0500
Output for 5.5.35
Sun, 22 May 2016 08:00:00 +0200 Wed, 25 May 2016 07:32:10 -0500
Output for 5.5.34
Sun, 10 Apr 2016 08:00:00 +0200 Wed, 13 Apr 2016 07:32:10 -0500
Output for 5.5.33
Tue, 08 Mar 2016 08:00:00 +0100 Wed, 09 Mar 2016 07:32:10 -0500
Output for 5.5.32
Thu, 17 Mar 2016 08:00:00 +0100 Wed, 23 Mar 2016 07:32:10 -0500
Output for 5.5.31
Sun, 20 Mar 2016 08:00:00 +0100 Wed, 23 Mar 2016 07:32:10 -0500
Output for 5.5.30
Fri, 01 Apr 2016 08:00:00 +0200 Wed, 06 Apr 2016 07:32:10 -0500
Output for 5.5.29
Sat, 16 Apr 2016 08:00:00 +0200 Wed, 20 Apr 2016 07:32:10 -0500
Output for 5.5.28
Wed, 20 Apr 2016 08:00:00 +0200 Wed, 20 Apr 2016 07:32:10 -0500
Output for 5.5.27
Fri, 22 Apr 2016 08:00:00 +0200 Wed, 27 Apr 2016 07:32:10 -0500
Output for 5.5.26
Tue, 26 Apr 2016 08:00:00 +0200 Wed, 27 Apr 2016 07:32:10 -0500
Output for 5.5.25
Thu, 28 Apr 2016 08:00:00 +0200 Wed, 04 May 2016 07:32:10 -0500
Output for 5.5.24
Mon, 23 May 2016 08:00:00 +0200 Wed, 25 May 2016 07:32:10 -0500
Output for 5.4.39 - 5.4.45
Mon, 21 Sep 2015 08:00:00 +0200 Wed, 23 Sep 2015 07:32:10 -0500
Output for 5.4.34 - 5.4.38
Sun, 15 Mar 2015 08:00:00 +0100 Wed, 18 Mar 2015 07:32:10 -0500
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/UnT8U on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/UnT8U on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/UnT8U on line 6