3v4l.org

run code in 300+ PHP versions simultaneously
<?php $storeSchedule = [ 'Sun' => [['12:00' => '01:00', '10:00' => '12:00']], 'Mon' => [['09:00' => '12:00']], 'Tue' => [['09:00' => '12:00']], 'Wed' => [['09:00' => '12:00']], 'Thu' => [['09:00' => '12:00'], ['22:50' => '23:00']], 'Fri' => [['09:00' => '12:00']], 'Sat' => [['12:00' => '01:00', '09:00' => '12:00']] ]; $today = date("D"); $closed = Null; foreach($storeSchedule[$today] as $opentimes){ foreach($opentimes as $open => $close){ $now = time(); if($now > strtotime(date("Y-m-d" . $open)) && $now < strtotime(date("Y-m-d" . $close))){ echo "store open now"; $closed = false; }else if($now < strtotime(date("Y-m-d" . $open))){ echo "store will open at " . date("Y-m-d" . $open); $closed = false; }else{ // Store is closed if($closed !== false) $closed = true; } } } if($closed){ // Dump the next open time var_dump($storeSchedule[date("D",strtotime($today)+86400)]); }

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.4.80.0330.00918.89
8.1.120.0030.00719.59
8.1.110.0080.00617.67
8.1.100.0100.00617.67
8.1.90.0090.00617.75
8.1.80.0140.00217.66
8.1.70.0120.00417.66
8.1.60.0090.00717.77
8.1.50.0090.00617.72
8.1.40.0140.00117.71
8.1.30.0100.00717.80
8.1.20.0120.00517.84
8.1.10.0140.00317.78
8.1.00.0140.00317.78
8.0.250.0110.00417.04
8.0.240.0050.00617.19
8.0.230.0080.00717.17
8.0.220.0090.00617.16
8.0.210.0090.00617.10
8.0.200.0080.00717.20
8.0.190.0120.00317.14
8.0.180.0110.00317.14
8.0.170.0030.01117.12
8.0.160.0100.00317.09
8.0.150.0140.00017.13
8.0.140.0060.00717.09
8.0.130.0100.00316.95
8.0.120.0040.01017.04
8.0.110.0080.00617.06
8.0.100.0100.00517.07
8.0.90.0070.00817.06
8.0.80.0090.00517.06
8.0.70.0060.01017.09
8.0.60.0100.00416.99
8.0.50.0090.00517.01
8.0.30.0120.00217.12
8.0.20.0120.00417.09
8.0.10.0110.00117.17
8.0.00.0020.00617.31
7.4.330.0170.00522.61
7.4.320.0110.00116.44
7.4.300.0090.00216.61
7.4.290.0080.00516.60
7.4.280.0120.00316.60
7.4.270.0100.00516.65
7.4.260.0060.00916.63
7.4.250.0090.00416.55
7.4.240.0090.00516.62
7.4.230.0120.00316.54
7.4.220.0060.00816.63
7.4.210.0080.00616.60
7.4.200.0080.00616.68
7.4.190.0120.00216.55
7.4.180.0110.00316.64
7.4.160.0070.00716.63
7.4.150.0130.00216.63
7.4.140.0070.00616.71
7.4.130.0040.01016.61
7.4.120.0070.00716.63
7.4.110.0130.00316.63
7.4.100.0090.00516.62
7.4.90.0110.00616.67
7.4.80.0090.00616.71
7.4.70.0090.00916.68
7.4.60.0130.00216.60
7.4.50.0090.00516.60
7.4.40.0060.00916.71
7.4.30.0070.00716.62
7.4.20.0120.00316.57
7.4.10.0100.00616.35
7.4.00.0080.00716.27
7.3.330.0110.00316.46
7.3.320.0100.00416.52
7.3.310.0050.00816.45
7.3.300.0090.00516.42
7.3.290.0100.00316.43
7.3.280.0120.00216.52
7.3.270.0110.00316.37
7.3.260.0110.00416.33
7.3.250.0130.00216.50
7.3.240.0080.00616.62
7.3.230.0150.00016.68
7.3.220.0090.00616.58
7.3.210.0120.00316.63
7.3.200.0090.00616.44
7.3.190.0120.00316.59
7.3.180.0100.00516.62
7.3.170.0070.00916.63
7.3.160.0070.00816.62
7.3.150.0130.00216.53
7.3.140.0090.00616.51
7.3.130.0080.00716.18
7.3.120.0050.01016.22
7.3.110.0080.00816.21
7.3.100.0090.00616.21
7.3.90.0090.00516.28
7.3.80.0090.00616.09
7.3.70.0090.00516.16
7.3.60.0070.00716.18
7.3.50.0110.00316.11
7.3.40.0040.01116.20
7.3.30.0120.00316.20
7.3.20.0100.00717.21
7.3.10.0120.00717.01
7.3.00.0120.00517.04
7.2.340.0120.00416.80
7.2.330.0110.00516.68
7.2.320.0050.01016.65
7.2.310.0130.00216.75
7.2.300.0080.00716.72
7.2.290.0130.00316.85
7.2.280.0100.00616.63
7.2.270.0060.00916.71
7.2.260.0080.00816.40
7.2.250.0090.00716.38
7.2.240.0080.00816.38
7.2.230.0110.00516.35
7.2.220.0100.00516.40
7.2.210.0080.00616.35
7.2.200.0090.00616.36
7.2.190.0090.00716.30
7.2.180.0110.00316.33
7.2.170.0090.00716.45
7.2.160.0090.00616.36
7.2.150.0080.00817.21
7.2.140.0100.00517.41
7.2.130.0130.00517.35
7.2.120.0150.00716.96
7.2.110.0260.00516.99
7.2.100.0150.00716.91
7.2.90.0170.00716.82
7.2.80.0160.00616.86
7.2.70.0280.00616.92
7.2.60.0170.00816.85
7.2.50.0260.00516.93
7.2.40.0180.00616.88
7.2.30.0190.00816.99
7.2.20.0190.00516.96
7.2.10.0200.00517.00
7.2.00.0250.00716.93
7.1.330.0130.00616.29
7.1.320.0140.00516.25
7.1.310.0080.01016.25
7.1.300.0140.00316.27
7.1.290.0110.00716.33
7.1.280.0100.00616.25
7.1.270.0090.00716.32
7.1.260.0110.00416.27
7.1.250.0080.00816.21
7.1.240.0200.00415.83
7.1.230.0250.00615.84
7.1.220.0160.00715.71
7.1.210.0210.00615.88
7.1.200.0200.00615.77
7.1.190.0170.00815.83
7.1.180.0230.00815.76
7.1.170.0170.00915.85
7.1.160.0250.00415.83
7.1.150.0200.00715.86
7.1.140.0210.00715.79
7.1.130.0330.00715.78
7.1.120.0300.00615.75
7.1.110.0260.00815.80
7.1.100.0290.00615.74
7.1.90.0200.00415.82
7.1.80.0360.00815.83
7.1.70.0210.00615.75
7.1.60.0190.00515.75
7.1.50.0270.00515.88
7.1.40.0220.00915.88
7.1.30.0320.00415.90
7.1.20.0250.00815.80
7.1.10.0210.00815.78
7.1.00.0250.00815.88
7.0.330.0110.00515.83
7.0.320.0100.00615.74
7.0.310.0130.00615.76
7.0.300.0120.00615.76
7.0.290.0100.00815.81
7.0.280.0110.00715.83
7.0.270.0150.00315.83
7.0.260.0100.00615.81
7.0.250.0090.00715.94
7.0.240.0130.00415.99
7.0.230.0120.00815.94
7.0.220.0150.01016.00
7.0.210.0100.00715.93
7.0.200.0140.00315.89
7.0.190.0110.00715.84
7.0.180.0090.00815.98
7.0.170.0130.00315.90
7.0.160.0110.00515.88
7.0.150.0130.00415.91
7.0.140.0100.00715.83
7.0.130.0140.00615.96
7.0.120.0110.00715.85
7.0.110.0110.00615.88
7.0.100.0130.00515.89
7.0.90.0110.00615.74
7.0.80.0110.00915.87
7.0.70.0110.00615.81
7.0.60.0130.00415.88
7.0.50.0130.00615.85
7.0.40.0120.00515.35
7.0.30.0110.00515.38
7.0.20.0090.00715.44
7.0.10.0130.00315.32
7.0.00.0160.00815.37
5.6.400.0070.00815.51
5.6.390.0080.00715.74
5.6.380.0080.00815.53
5.6.370.0080.00915.77
5.6.360.0130.00615.80
5.6.350.0130.00515.66
5.6.340.0110.00815.67
5.6.330.0130.00615.77
5.6.320.0140.00515.82
5.6.310.0130.00415.62
5.6.300.0130.00515.67
5.6.290.0100.00615.68
5.6.280.0110.00515.76
5.6.270.0100.00815.74
5.6.260.0130.00715.73
5.6.250.0070.01015.76
5.6.240.0140.00615.72
5.6.230.0100.00815.70
5.6.220.0100.00715.82
5.6.210.0100.00815.71
5.6.200.0110.00615.69
5.6.190.0100.00715.69
5.6.180.0070.00915.66
5.6.170.0120.00515.74
5.6.160.0100.00815.85
5.6.150.0130.00515.81
5.6.140.0130.00415.83
5.6.130.0080.00915.79
5.6.120.0110.00615.67
5.6.110.0080.00915.74
5.6.100.0100.00715.58
5.6.90.0110.00515.54
5.6.80.0100.00615.65
5.6.70.0120.00615.78
5.6.60.0120.00415.82
5.6.50.0070.00815.63
5.6.40.0130.00515.72
5.6.30.0090.00815.61
5.6.20.0110.00515.60
5.6.10.0100.00615.54
5.6.00.0120.00515.64

preferences:
38.28 ms | 403 KiB | 5 Q