3v4l.org

run code in 300+ PHP versions simultaneously
<?php // -------- PHP STORE HOURS --------- // ---------- Version 1.1 ----------- // -------- BY CORY ETZKORN --------- // -------- coryetzkorn.com --------- // -------- EDIT FOLLOWING SECTION ONLY --------- // Set your timezone (codes listed at http://php.net/manual/en/timezones.php) // Delete the following line if you've already defined a timezone elsewhere. date_default_timezone_set('Europe/Stockholm'); // Define daily open hours. Must be in 24-hour format, separated by dash. $time_range_mon = '11:00-20:30'; $time_range_tue = '11:00-20:30'; $time_range_wed = '11:00-20:30'; $time_range_thu = '11:00-20:30'; $time_range_fri = '11:00-21:30'; $time_range_sat = '11:00-21:30'; $time_range_sun = '12:00-19:30'; // OPTIONAL: Output current day's open hours $echo_daily_hours = false; // Switch to FALSE to hide numerical display of current hours $time_output = 'g a'; // Enter custom time output format (options listed here: http://php.net/manual/en/function.date.php) $time_separator = ' - '; // Choose how to indicate range (i.e XX - XX, XX to XX, XX until XX) // -------- END EDITING -------- // Gets current day of week $status_today = date("D"); // Gets current time of day in 00:00 format $current_time = date("G:i"); // Makes current time of day computer-readable $current_time_x = strtotime($current_time); // Builds an array, assigning user-defined time ranges to each day of week $all_days = array("Mon" => $time_range_mon, "Tue" => $time_range_tue, "Wed" => $time_range_wed, "Thu" => $time_range_thu, "Fri" => $time_range_fri, "Sat" => $time_range_sat, "Sun" => $time_range_sun); foreach ($all_days as &$each_day) { $each_day = explode("-", $each_day); $each_day[0] = strtotime($each_day[0]); $each_day[1] = strtotime($each_day[1]); } // Defines array of possible days of week $week_days = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"); // Compares current day of week to possible days of week and determines open vs closed output based on current day and time. foreach ($week_days as &$each_week_day) { if ($status_today == $each_week_day) { echo ''; if (($all_days[$each_week_day][0] <= $current_time_x) && ($all_days[$each_week_day][1] >= $current_time_x)) { } else { header( 'Location: http://www.bristolhotel.com/pizzeria/offlinepizza.php' ) ; } } } ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0030.01016.75
8.3.50.0130.00522.20
8.3.40.0110.01118.92
8.3.30.0110.00419.01
8.3.20.0060.00320.46
8.3.10.0040.00423.53
8.3.00.0040.00419.50
8.2.180.0120.00816.88
8.2.170.0140.00322.96
8.2.160.0100.00320.39
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00422.27
8.2.110.0090.00021.91
8.2.100.0060.00618.03
8.2.90.0050.00319.15
8.2.80.0050.00317.97
8.2.70.0030.00617.75
8.2.60.0000.01117.68
8.2.50.0080.00018.07
8.2.40.0030.00620.01
8.2.30.0000.00818.16
8.2.20.0050.00317.96
8.2.10.0000.00818.24
8.2.00.0000.00817.80
8.1.280.0100.01025.92
8.1.270.0080.00023.97
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0060.00323.81
8.1.230.0100.00319.01
8.1.220.0050.00317.79
8.1.210.0000.00818.77
8.1.200.0060.00317.38
8.1.190.0030.00617.50
8.1.180.0040.00418.10
8.1.170.0000.00818.68
8.1.160.0000.00722.04
8.1.150.0040.00418.78
8.1.140.0050.00217.67
8.1.130.0000.00717.76
8.1.120.0040.00417.66
8.1.110.0050.00517.57
8.1.100.0060.00317.64
8.1.90.0000.00717.66
8.1.80.0040.00417.69
8.1.70.0050.00317.59
8.1.60.0000.00917.74
8.1.50.0040.00417.66
8.1.40.0030.00617.68
8.1.30.0000.00817.68
8.1.20.0040.00417.75
8.1.10.0040.00417.75
8.1.00.0080.00017.55
8.0.300.0030.00518.77
8.0.290.0040.00417.29
8.0.280.0000.00818.55
8.0.270.0030.00317.34
8.0.260.0070.00017.34
8.0.250.0030.00317.21
8.0.240.0000.00817.20
8.0.230.0000.00717.09
8.0.220.0000.00617.10
8.0.210.0070.00017.08
8.0.200.0000.00717.13
8.0.190.0030.00617.03
8.0.180.0070.00017.11
8.0.170.0050.00317.14
8.0.160.0030.00417.16
8.0.150.0080.00016.96
8.0.140.0040.00416.98
8.0.130.0030.00313.47
8.0.120.0040.00416.93
8.0.110.0030.00616.93
8.0.100.0070.00017.13
8.0.90.0000.00716.91
8.0.80.0100.01017.03
8.0.70.0000.00717.10
8.0.60.0040.00417.08
8.0.50.0000.00717.05
8.0.30.0090.00917.50
8.0.20.0100.00917.40
8.0.10.0040.00417.20
8.0.00.0090.00917.04
7.4.330.0060.00015.14
7.4.320.0030.00316.81
7.4.300.0040.00416.66
7.4.290.0030.00316.65
7.4.280.0030.00316.67
7.4.270.0000.00716.73
7.4.260.0030.00316.73
7.4.250.0080.00016.52
7.4.240.0020.00616.67
7.4.230.0000.00716.76
7.4.220.0130.00316.64
7.4.210.0070.00816.71
7.4.200.0030.00316.78
7.4.190.0040.00416.57
7.4.160.0110.00716.75
7.4.150.0060.01317.40
7.4.140.0060.01117.86
7.4.130.0070.01216.72
7.4.120.0130.00516.66
7.4.110.0030.01616.74
7.4.100.0110.00616.67
7.4.90.0120.00616.83
7.4.80.0160.00319.39
7.4.70.0340.01316.80
7.4.60.0070.01616.56
7.4.50.0050.00316.69
7.4.40.0120.00416.61
7.4.30.0100.00716.73
7.4.00.0030.01314.97
7.3.330.0090.00013.42
7.3.320.0050.00013.20
7.3.310.0040.00416.32
7.3.300.0030.00316.43
7.3.290.0070.00716.59
7.3.280.0120.00716.43
7.3.270.0200.00317.40
7.3.260.0100.01316.59
7.3.250.0150.00216.55
7.3.240.0090.00816.66
7.3.230.0140.00316.68
7.3.210.0080.01116.79
7.3.200.0190.00319.39
7.3.190.0150.00616.44
7.3.180.0210.00316.75
7.3.170.0140.00716.59
7.3.160.0080.00816.49
7.3.120.0080.00715.06
7.3.110.0060.01114.96
7.3.100.0080.00614.98
7.3.90.0080.00414.83
7.3.80.0100.00615.02
7.3.70.0030.00914.67
7.3.60.0040.01115.06
7.3.50.0090.00614.99
7.3.40.0110.00315.04
7.3.30.0040.00414.98
7.3.20.0100.00716.85
7.3.10.0090.00416.74
7.3.00.0120.00816.86
7.2.330.0150.00416.97
7.2.320.0100.01316.56
7.2.310.0150.00916.81
7.2.300.0030.01316.75
7.2.290.0110.00716.98
7.2.250.0080.00615.29
7.2.240.0100.00715.15
7.2.230.0080.00815.14
7.2.220.0040.01115.07
7.2.210.0040.01415.06
7.2.200.0040.00715.25
7.2.190.0030.00615.26
7.2.180.0090.00615.27
7.2.170.0100.00715.21
7.2.130.0040.01016.96
7.2.120.0080.01116.98
7.2.110.0110.00717.00
7.2.100.0140.00917.12
7.2.90.0110.00816.99
7.2.80.0140.00617.09
7.2.70.0120.00717.09
7.2.60.0070.00817.12
7.2.50.0070.00917.07
7.2.40.0080.00917.01
7.2.30.0040.00917.08
7.2.20.0050.01017.03
7.2.10.0080.00617.14
7.2.00.0030.00917.62
7.1.330.0000.01615.99
7.1.320.0030.01016.05
7.1.310.0070.01015.74
7.1.300.0060.00915.83
7.1.290.0030.01316.11
7.1.280.0060.00915.94
7.1.270.0070.00715.74
7.1.260.0100.00315.67
7.1.250.0120.00815.88
7.1.240.0100.00316.05
7.1.230.0070.00716.04
7.1.220.0050.00516.10
7.1.210.0090.00316.01
7.1.200.0070.00616.05
7.1.190.0100.00315.86
7.1.180.0040.00716.09
7.1.170.0030.00716.10
7.1.160.0110.00715.81
7.1.150.0040.01115.83
7.1.140.0000.01615.84
7.1.130.0040.01116.00
7.1.120.0000.00816.09
7.1.110.0060.00615.86
7.1.100.0070.00517.05
7.1.90.0100.00315.93
7.1.80.0030.00916.00
7.1.70.0070.00616.61
7.1.60.0050.01317.83
7.1.50.0180.00825.51
7.1.40.0090.00615.89
7.1.30.0070.00315.79
7.1.20.0040.01115.95
7.1.10.0080.00516.04
7.1.00.0040.04119.22
7.0.330.0060.01015.61
7.0.320.0030.01015.33
7.0.310.0000.00815.60
7.0.300.0100.00315.39
7.0.290.0040.00815.53
7.0.280.0030.01215.30
7.0.270.0000.01315.72
7.0.260.0060.00915.55
7.0.250.0030.01015.44
7.0.240.0140.00015.54
7.0.230.0000.00915.44
7.0.220.0110.00415.61
7.0.210.0070.00715.60
7.0.200.0050.00716.06
7.0.190.0030.00715.41
7.0.180.0040.01115.70
7.0.170.0060.00315.57
7.0.160.0060.00615.49
7.0.150.0120.00615.46
7.0.140.0100.03618.75
7.0.130.0070.00415.40
7.0.120.0110.00515.81
7.0.110.0130.00415.61
7.0.100.0130.02417.74
7.0.90.0080.04217.63
7.0.80.0120.02717.64
7.0.70.0100.04017.68
7.0.60.0060.02617.85
7.0.50.0310.04618.02
7.0.40.0050.04716.71
7.0.30.0070.04216.81
7.0.20.0040.02816.91
7.0.10.0020.03016.71
7.0.00.0090.03516.77
5.6.380.0030.01314.70
5.6.370.0030.01014.44
5.6.360.0090.00314.56
5.6.350.0090.00314.45
5.6.340.0000.01414.80
5.6.330.0030.01414.77
5.6.320.0040.00414.23
5.6.310.0090.00614.84
5.6.300.0080.01114.37
5.6.290.0110.00414.63
5.6.280.0090.04217.72
5.6.270.0140.01014.59
5.6.260.0190.00514.79
5.6.250.0110.02817.71
5.6.240.0090.04817.65
5.6.230.0110.04617.56
5.6.220.0030.04817.41
5.6.210.0090.04217.62
5.6.200.0120.03517.71
5.6.190.0080.04817.86
5.6.180.0060.04617.73
5.6.170.0080.03817.74
5.6.160.0100.04217.75
5.6.150.0100.04217.74
5.6.140.0050.04817.79
5.6.130.0060.04617.74
5.6.120.0090.04318.09
5.6.110.0040.04917.84
5.6.100.0070.03717.70
5.6.90.0100.04117.77
5.6.80.0090.03617.42
5.6.70.0030.04817.48
5.6.60.0060.04417.57
5.6.50.0050.02317.49
5.6.40.0100.04317.49
5.6.30.0050.04417.47
5.6.20.0070.03417.41
5.6.10.0020.04817.42
5.6.00.0110.03517.34
5.5.380.0040.02615.89
5.5.370.0060.02615.94
5.5.360.0140.03815.91
5.5.350.0100.03815.94
5.5.340.0100.04116.15
5.5.330.0140.03616.13
5.5.320.0060.02616.04
5.5.310.0100.04016.17
5.5.300.0020.04116.08
5.5.290.0020.05016.18
5.5.280.0030.04216.04
5.5.270.0050.03016.14
5.5.260.0040.04916.16
5.5.250.0050.03716.05
5.5.240.0060.02215.85
5.5.230.0070.04215.81
5.5.220.0070.04015.87
5.5.210.0050.03915.87
5.5.200.0050.04415.86
5.5.190.0050.04715.78
5.5.180.0040.04415.78
5.5.170.0000.01211.43
5.5.160.0090.03815.86
5.5.150.0040.03415.81
5.5.140.0050.04215.79
5.5.130.0030.04615.70
5.5.120.0100.03815.84
5.5.110.0060.02815.84
5.5.100.0090.04015.76
5.5.90.0050.04415.77
5.5.80.0060.04415.79
5.5.70.0080.03515.72
5.5.60.0070.04415.76
5.5.50.0090.03915.70
5.5.40.0050.04015.70
5.5.30.0070.03615.68
5.5.20.0080.04115.76
5.5.10.0080.03515.74
5.5.00.0030.03115.77
5.4.450.0100.03915.36
5.4.440.0070.02815.37
5.4.430.0070.04415.37
5.4.420.0120.03815.41
5.4.410.0080.02815.33
5.4.400.0070.02315.26
5.4.390.0030.02515.12
5.4.380.0000.02415.23
5.4.370.0040.03715.33
5.4.360.0130.02915.27
5.4.350.0080.04015.11
5.4.340.0030.03415.12
5.4.330.0080.00611.43
5.4.320.0030.04415.24
5.4.310.0140.03415.28
5.4.300.0060.04015.16
5.4.290.0070.02915.16
5.4.280.0050.04415.27
5.4.270.0050.04115.26
5.4.260.0040.04215.33
5.4.250.0090.03815.22
5.4.240.0090.03115.20
5.4.230.0060.03115.18
5.4.220.0060.04315.20
5.4.210.0100.02515.27
5.4.200.0050.03115.19
5.4.190.0050.04115.11
5.4.180.0060.03015.17
5.4.170.0070.04215.12
5.4.160.0070.03315.32
5.4.150.0050.02515.25
5.4.140.0060.03413.91
5.4.130.0090.03313.91
5.4.120.0020.02813.87
5.4.110.0060.02513.90
5.4.100.0030.03813.92
5.4.90.0070.03913.84
5.4.80.0050.02613.89
5.4.70.0100.02113.91
5.4.60.0060.02413.87
5.4.50.0050.03713.87
5.4.40.0090.03313.89
5.4.30.0090.03313.82
5.4.20.0100.03913.80
5.4.10.0080.04013.86
5.4.00.0070.03413.61
5.3.290.0080.03913.18
5.3.280.0050.02813.18
5.3.270.0070.02713.18
5.3.260.0020.02913.18
5.3.250.0090.03613.18
5.3.240.0050.04113.18
5.3.230.0020.04513.18
5.3.220.0050.02513.18
5.3.210.0100.03513.18
5.3.200.0080.02813.18
5.3.190.0030.04413.18
5.3.180.0070.03913.18
5.3.170.0050.03613.18
5.3.160.0030.04113.18
5.3.150.0060.02413.18
5.3.140.0060.04513.18
5.3.130.0050.03713.18
5.3.120.0080.02113.18
5.3.110.0080.04213.18
5.3.100.0080.02813.18
5.3.90.0050.02113.18
5.3.80.0050.02413.18
5.3.70.0060.02313.18
5.3.60.0060.03913.18
5.3.50.0060.04013.18
5.3.40.0050.04413.18
5.3.30.0060.03813.18
5.3.20.0080.02813.18
5.3.10.0040.04313.18
5.3.00.0050.04013.18
5.2.170.0020.02513.18
5.2.160.0050.02113.18
5.2.150.0020.03113.18
5.2.140.0080.01813.18
5.2.130.0060.03213.18
5.2.120.0070.03213.18
5.2.110.0060.02213.18
5.2.100.0070.03013.18
5.2.90.0040.03313.18
5.2.80.0080.03013.18
5.2.70.0100.02913.18
5.2.60.0020.02513.18
5.2.50.0080.01913.18
5.2.40.0050.02913.18
5.2.30.0050.02813.18
5.2.20.0040.03613.18
5.2.10.0020.02013.18
5.2.00.0060.02813.18
5.1.60.0080.01713.18
5.1.50.0050.02613.18
5.1.40.0040.02213.18
5.1.30.0040.01913.18
5.1.20.0020.02513.18
5.1.10.0040.02113.18
5.1.00.0030.02913.18
5.0.50.0070.01013.18
5.0.40.0040.01413.18
5.0.30.0000.03113.18
5.0.20.0020.02513.18
5.0.10.0000.02213.18
5.0.00.0040.03413.18
4.4.90.0000.01413.18
4.4.80.0020.01213.18
4.4.70.0000.02213.18
4.4.60.0020.01313.18
4.4.50.0020.01213.18
4.4.40.0000.02813.18
4.4.30.0020.01813.18
4.4.20.0000.01313.18
4.4.10.0000.01313.18
4.4.00.0050.01313.18
4.3.110.0020.01313.18
4.3.100.0020.02013.18
4.3.90.0030.01813.18
4.3.80.0000.02213.18
4.3.70.0030.01713.18
4.3.60.0000.01213.18
4.3.50.0020.01513.18
4.3.40.0030.02713.18
4.3.30.0000.02213.18
4.3.20.0000.01513.18
4.3.10.0020.01813.18
4.3.00.0010.02013.18

preferences:
41.97 ms | 400 KiB | 5 Q