3v4l.org

run code in 300+ PHP versions simultaneously
<?php function setting($v) { $db = [ 'opening_time_Sunday' => '10:30', 'closing_time_Sunday' => '00:00', 'opening_time_Monday' => '09:30', 'closing_time_Monday' => '01:30', 'opening_time_Tuesday' => '09:30', 'closing_time_Tuesday' => '01:30', 'opening_time_Wednesday' => '09:30', 'closing_time_Wednesday' => '01:30', 'opening_time_Thursday' => '09:30', 'closing_time_Thursday' => '01:30', 'opening_time_Friday' => '09:30', 'closing_time_Friday' => '23:00', 'opening_time_Saturday' => '10:30', 'closing_time_Saturday' => '00:00', ]; return $db[$v]; } function Today($dateString = null) { $currentDate = new \DateTimeImmutable($dateString); $priorDate = $currentDate->sub(new \DateInterval('P1D')); $yesterday = $priorDate->format('l'); $priorClosing = setting('closing_time_' . $yesterday); $closeDate = $currentDate->setTime(...explode(':', $priorClosing)); if ($closeDate->format('a') === 'am' && $currentDate < $closeDate) { //check if the the closing has not occurred yet $currentDate = $priorDate; } $today = $currentDate->format('l'); $start = setting('opening_time_' . $today); $end = setting('closing_time_' . $today); return $today . ': ' . $start . " - " . $end; } $dates = []; for ($i=0;$i<7;$i++) { $date = \date_create('2018-10-08'); if ($i > 0) { $date->modify('+' . $i . ' day'); } $dates[$date->format('l')] = [ '00:15' => Today($date->setTime(0, 15)->format('Y-m-d H:i:s')), '23:00' => Today($date->setTime(23, 0, 0)->format('Y-m-d H:i:s')) ]; } echo "Day \t|\t00:15:00\t\t\t|\t23:00:00\n"; foreach($dates as $day => $times) { echo "$day \t|\t{$times['00:15']} \t|\t{$times['23:00']}\n"; }

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.5.10.0120.00616.68
8.5.00.0140.00720.26
8.4.150.0020.00014.05
8.4.140.0130.01117.98
8.4.130.0120.00819.03
8.4.120.0080.00523.96
8.4.110.0130.00719.01
8.4.100.0120.00917.87
8.4.90.0120.01020.52
8.4.80.0100.00720.52
8.4.70.0080.00919.11
8.4.60.0110.01020.50
8.4.50.0110.01018.75
8.4.40.0100.00719.82
8.4.30.0030.00617.82
8.4.20.0030.00620.63
8.4.10.0000.00918.09
8.3.280.0150.00618.68
8.3.270.0070.01416.82
8.3.260.0140.00616.70
8.3.250.0090.00718.90
8.3.240.0110.00817.34
8.3.230.0120.00816.99
8.3.220.0050.00918.95
8.3.210.0050.00316.73
8.3.200.0080.00516.66
8.3.190.0070.00417.32
8.3.180.0070.00719.13
8.3.170.0150.00317.37
8.3.160.0130.00616.68
8.3.150.0070.01117.32
8.3.140.0000.00916.66
8.3.130.0100.00718.54
8.3.120.0030.00719.11
8.3.110.0130.01020.94
8.3.100.0060.01224.06
8.3.90.0060.00326.77
8.3.80.0030.00618.68
8.3.70.0120.00918.44
8.3.60.0140.00718.43
8.3.50.0050.00917.58
8.3.40.0100.00618.80
8.3.30.0160.00318.86
8.3.20.0050.00319.04
8.3.10.0050.00321.90
8.3.00.0000.00821.95
8.2.290.0110.00917.34
8.2.280.0080.00418.58
8.2.270.0130.00616.83
8.2.260.0060.00318.84
8.2.250.0090.00918.79
8.2.240.0070.01318.99
8.2.230.0090.00022.58
8.2.220.0080.00037.54
8.2.210.0090.00926.77
8.2.200.0030.00617.00
8.2.190.0070.01018.77
8.2.180.0040.01116.48
8.2.170.0110.00722.96
8.2.160.0110.00419.29
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00820.08
8.2.110.0030.00620.46
8.2.100.0080.00418.09
8.2.90.0050.00318.00
8.2.80.0000.00817.97
8.2.70.0000.00818.05
8.2.60.0080.00017.88
8.2.50.0000.00817.75
8.2.40.0030.00619.37
8.2.30.0000.00719.35
8.2.20.0040.00418.36
8.2.10.0060.00318.24
8.2.00.0000.00817.93
8.1.330.0130.00716.59
8.1.320.0110.00916.14
8.1.310.0110.00818.60
8.1.300.0040.00918.19
8.1.290.0120.00318.88
8.1.280.0120.00325.92
8.1.270.0040.00420.40
8.1.260.0200.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00919.67
8.1.230.0090.00317.95
8.1.220.0040.00417.89
8.1.210.0060.00318.77
8.1.200.0030.00717.60
8.1.190.0040.00419.18
8.1.180.0060.00319.14
8.1.170.0060.00317.77
8.1.160.0040.00419.05
8.1.150.0040.00418.98
8.1.140.0070.00020.71
8.1.130.0030.00320.30
8.1.120.0040.00417.63
8.1.110.0030.00517.65
8.1.100.0000.00717.76
8.1.90.0040.00417.66
8.1.80.0050.00317.62
8.1.70.0000.00817.66
8.1.60.0000.00817.69
8.1.50.0040.00417.63
8.1.40.0000.00817.65
8.1.30.0040.00417.83
8.1.20.0040.00417.75
8.1.10.0040.00417.70
8.1.00.0030.00517.67
8.0.300.0060.00318.77
8.0.290.0060.00316.88
8.0.280.0000.00718.60
8.0.270.0030.00617.09
8.0.260.0060.00020.35
8.0.250.0070.00017.25
8.0.240.0030.00617.23
8.0.230.0040.00417.26
8.0.220.0000.00717.05
8.0.210.0000.00717.06
8.0.200.0000.00817.22
8.0.190.0040.00417.09
8.0.180.0030.00517.17
8.0.170.0000.00817.24
8.0.160.0040.00417.25
8.0.150.0030.00517.18
8.0.140.0000.00717.13
8.0.130.0000.00613.52
8.0.120.0000.00917.16
8.0.110.0020.00517.12
8.0.100.0000.00817.21
8.0.90.0070.00017.05
8.0.80.0110.00817.17
8.0.70.0040.00417.17
8.0.60.0040.00417.03
8.0.50.0030.00617.19
8.0.30.0100.01017.23
8.0.20.0140.00417.46
8.0.10.0000.00817.29
8.0.00.0110.00817.02
7.4.330.0060.00015.55
7.4.320.0000.00616.76
7.4.300.0040.00416.73
7.4.290.0000.01016.82
7.4.280.0000.00916.82
7.4.270.0000.00716.80
7.4.260.0080.00016.71
7.4.250.0040.00316.77
7.4.240.0070.00016.63
7.4.230.0000.00716.72
7.4.220.0080.00016.62
7.4.210.0070.00916.75
7.4.200.0030.00316.56
7.4.160.0100.00816.72
7.4.140.0130.00817.86
7.4.130.0070.01416.63
7.4.120.0110.01016.80
7.4.110.0110.00816.73
7.4.100.0100.01316.68
7.4.90.0030.02216.68
7.4.80.0100.01019.39
7.4.70.0190.00316.84
7.4.60.0110.00616.84
7.4.50.0090.00616.85
7.4.40.0060.01216.96
7.4.30.0100.00616.79
7.4.20.0070.01116.77
7.4.10.0110.00815.93
7.4.00.0100.00815.68
7.3.330.0020.00313.51
7.3.320.0030.00313.36
7.3.310.0000.00816.49
7.3.300.0050.00216.46
7.3.290.0050.00216.59
7.3.280.0060.00916.57
7.3.260.0130.00816.74
7.3.240.0070.01116.73
7.3.230.0100.00716.56
7.3.210.0140.00316.76
7.3.200.0110.00716.65
7.3.190.0150.00716.93
7.3.180.0090.01216.77
7.3.170.0070.01016.59
7.3.160.0060.01016.88
7.3.150.0040.01216.55
7.3.140.0000.01516.77
7.3.130.0050.01215.84
7.3.120.0110.00515.90
7.3.110.0100.00715.89
7.3.100.0070.00515.82
7.3.90.0050.00915.80
7.3.80.0090.00715.96
7.3.70.0060.01215.73
7.3.60.0080.00815.69
7.3.50.0070.00815.99
7.3.40.0070.01115.89
7.3.30.0090.00515.71
7.3.20.0050.01016.73
7.3.10.0060.00816.87
7.3.00.0140.00416.80
7.2.330.0190.00017.06
7.2.320.0030.01416.71
7.2.310.0090.00617.14
7.2.300.0120.01216.84
7.2.290.0140.01017.01
7.2.280.0080.00816.96
7.2.270.0060.01016.92
7.2.260.0040.01416.17
7.2.250.0050.01616.11
7.2.240.0120.00816.19
7.2.230.0100.01016.21
7.2.220.0050.01216.03
7.2.210.0100.00816.19
7.2.200.0090.00616.10
7.2.190.0020.01115.97
7.2.180.0050.01116.03
7.2.170.0060.00916.21
7.2.160.0100.00516.16
7.2.150.0050.01116.90
7.2.140.0060.01017.09
7.2.130.0050.00817.10
7.2.120.0090.00617.09
7.2.110.0030.01217.07
7.2.100.0590.01016.43
7.2.90.0570.00716.39
7.2.80.0700.00816.25
7.2.70.0590.01216.50
7.2.60.0700.01016.52
7.2.50.0630.01216.43
7.2.40.0770.01116.50
7.2.30.0110.00616.38
7.2.20.0090.01116.40
7.2.10.0120.00916.43
7.2.00.0240.00816.51
7.1.330.0090.00915.77
7.1.320.0050.01316.10
7.1.310.0110.00815.86
7.1.300.0110.00715.81
7.1.290.0070.00815.85
7.1.280.0060.00916.03
7.1.270.0050.00815.87
7.1.260.0060.01316.02
7.1.250.0060.00815.85
7.1.240.0030.01115.78
7.1.230.0090.00515.87
7.1.220.0590.01115.36
7.1.210.0650.00615.34
7.1.200.0600.01015.27
7.1.190.0890.00415.30
7.1.180.0640.01015.23
7.1.170.0660.00715.34
7.1.160.0760.00815.31
7.1.150.0870.01115.32
7.1.140.0690.00915.24
7.1.130.0550.01315.27
7.1.120.0340.01015.25
7.1.110.0570.00915.27
7.1.100.0170.00915.33
7.1.90.0510.00915.32
7.1.80.0110.00815.30
7.1.70.0410.00715.28
7.1.60.0400.00921.41
7.1.50.0470.01021.32
7.1.40.0490.01121.28
7.1.30.0610.00521.35
7.1.20.0310.01321.23
7.1.10.0060.01015.27
7.1.00.0170.01015.24
7.0.330.0070.00615.19
7.0.320.0060.00915.52
7.0.310.0110.00515.57
7.0.300.0070.00815.35
7.0.290.0070.00715.55
7.0.280.0040.01115.35
7.0.270.0110.00815.44
7.0.260.0050.00815.47
7.0.250.0090.00915.47
7.0.240.0070.00615.41
7.0.230.0050.00715.48
7.0.220.0060.00615.31
7.0.210.0080.00515.50
7.0.200.0020.01315.57
7.0.190.0050.01315.58
7.0.180.0020.01615.57
7.0.170.0070.01115.50
7.0.160.0040.01115.57
7.0.150.0050.01415.56
7.0.140.0280.01015.61
7.0.130.0060.01015.54
7.0.120.0050.00815.41
7.0.110.0070.00715.53
7.0.100.0070.00715.61
7.0.90.0050.00815.58
7.0.80.0060.00915.56
7.0.70.0070.01015.43
7.0.60.0100.00515.57
7.0.50.0050.00915.50
7.0.40.0090.00514.58
7.0.30.0020.01514.48
7.0.20.0050.01014.60
7.0.10.0040.01214.44
7.0.00.0040.01114.56
5.6.400.0100.01015.62
5.6.390.0080.01015.54
5.6.380.0080.00915.19
5.6.370.0000.01915.48
5.6.360.0070.01015.59
5.6.350.0080.00915.48
5.6.340.0030.01415.44
5.6.330.0070.00815.50
5.6.320.0040.01415.50
5.6.310.0040.01115.46
5.6.300.0060.00915.45
5.6.290.0100.01015.52
5.6.280.0040.01315.52
5.6.270.0100.00915.31
5.6.260.0080.00915.29
5.6.250.0080.00715.62
5.6.240.0100.00515.40
5.6.230.0050.01515.43
5.6.220.0040.01115.46
5.6.210.0110.00515.30
5.6.200.0050.01215.36
5.6.190.0010.01615.39
5.6.180.0090.01015.31
5.6.170.0090.01015.32
5.6.160.0110.00515.20
5.6.150.0050.01115.20
5.6.140.0070.01415.60
5.6.130.0070.01015.49
5.6.120.0070.00715.50
5.6.110.0070.00715.53
5.6.100.0050.01415.44
5.6.90.0080.00815.40
5.6.80.0140.00715.27
5.6.70.0080.00715.15
5.6.60.0060.00915.29
5.6.50.0090.00515.19
5.6.40.0080.00815.12
5.6.30.0080.00815.37
5.6.20.0060.01215.42
5.6.10.0090.01015.36
5.6.00.0060.00515.69
5.5.380.0140.01115.63
5.5.370.0180.00615.44
5.5.360.0170.00915.47
5.5.350.0090.00915.35
5.5.340.0050.01715.44
5.5.330.0080.02015.55
5.5.320.0140.01415.35
5.5.310.0180.00815.63
5.5.300.0200.00915.64
5.5.290.0200.00715.50
5.5.280.0190.00315.63
5.5.270.0080.01215.30
5.5.260.0110.01415.32
5.5.250.0110.01515.45
5.5.240.0150.01115.32
5.5.230.0140.00815.54
5.5.220.0120.01215.44
5.5.210.0090.01315.39
5.5.200.0110.01015.59
5.5.190.0160.00615.45
5.5.180.0150.01215.38
5.5.170.0190.00615.34
5.5.160.0170.00815.68
5.5.150.0140.01515.60
5.5.140.0070.01715.58
5.5.130.0140.00715.50
5.5.120.0130.01015.67
5.5.110.0110.00815.13
5.5.100.0070.01415.54
5.5.90.0050.01515.50
5.5.80.0060.01615.76
5.5.70.0100.00915.50
5.5.60.0140.01015.49
5.5.50.0150.01215.24
5.5.40.0140.00715.13
5.5.30.0200.00015.19
5.5.20.0040.01615.43
5.5.10.0100.01015.43
5.5.00.0220.00315.22
5.4.450.0070.01712.46
5.4.440.0130.00312.50
5.4.430.0080.00812.05
5.4.420.0180.00712.36
5.4.410.0120.01012.51
5.4.400.0110.00712.41
5.4.390.0140.00512.22
5.4.380.0130.00512.57
5.4.370.0120.00812.16
5.4.360.0110.00412.48
5.4.350.0130.00412.25
5.4.340.0140.00612.40
5.4.330.0040.01312.23
5.4.320.0150.00512.22
5.4.310.0110.00712.34
5.4.300.0060.01112.30
5.4.290.0050.01012.33
5.4.280.0110.00812.47
5.4.270.0080.00812.20
5.4.260.0130.00312.28
5.4.250.0080.00812.04
5.4.240.0000.01612.50
5.4.230.0100.00712.03
5.4.220.0120.00712.21
5.4.210.0130.00212.47
5.4.200.0110.00512.55
5.4.190.0080.00812.09
5.4.180.0050.01012.35
5.4.170.0090.00612.06
5.4.160.0120.00312.19
5.4.150.0130.00312.47
5.4.140.0120.00612.25
5.4.130.0040.01112.18
5.4.120.0090.01312.23
5.4.110.0080.01312.32
5.4.100.0110.00612.21
5.4.90.0110.00612.22
5.4.80.0130.00512.39
5.4.70.0120.00812.45
5.4.60.0080.01112.16
5.4.50.0090.00612.36
5.4.40.0060.00712.27
5.4.30.0090.00612.10
5.4.20.0060.01212.16
5.4.10.0090.00612.26
5.4.00.0100.01012.19
5.3.290.0110.01012.75
5.3.280.0100.01012.68
5.3.270.0040.01212.73
5.3.260.0130.00912.78
5.3.250.0130.00512.76
5.3.240.0140.00312.65
5.3.230.0080.01312.62
5.3.220.0120.00512.82
5.3.210.0120.01212.92
5.3.200.0060.01112.71
5.3.190.0120.00812.78
5.3.180.0090.01312.89
5.3.170.0090.00912.89
5.3.160.0160.00612.91
5.3.150.0000.01612.88
5.3.140.0130.00512.78
5.3.130.0150.00812.89
5.3.120.0140.00212.83
5.3.110.0130.01312.75
5.3.100.0130.01312.76
5.3.90.0120.01212.80
5.3.80.0150.00712.76
5.3.70.0200.00312.69
5.3.60.0090.01212.73
5.3.50.0040.01212.66
5.3.40.0110.00812.74
5.3.30.0040.01112.76
5.3.20.0100.00512.73
5.3.10.0100.00712.54
5.3.00.0100.00412.52
5.2.170.0090.00611.74
5.2.160.0180.00012.03
5.2.150.0130.00311.75
5.2.140.0130.00311.71
5.2.130.0120.00311.79
5.2.120.0110.00311.82
5.2.110.0090.00611.71
5.2.100.0110.00511.71
5.2.90.0130.00711.79
5.2.80.0090.00911.78
5.2.70.0070.01311.67
5.2.60.0160.00011.58
5.2.50.0090.00511.64
5.2.40.0040.00911.76
5.2.30.0070.00711.91
5.2.20.0100.00511.66
5.2.10.0140.00511.50
5.2.00.0060.01211.42
5.1.60.0100.00511.37
5.1.50.0060.01211.37
5.1.40.0110.00811.37
5.1.30.0120.00611.37
5.1.20.0070.00711.37
5.1.10.0060.00611.37
5.1.00.0090.00611.37
5.0.50.0070.00711.37
5.0.40.0040.00811.37
5.0.30.0080.00611.37
5.0.20.0100.00311.37
5.0.10.0060.00611.37
5.0.00.0060.00611.37
4.4.90.0000.01011.37
4.4.80.0040.00411.37
4.4.70.0040.00411.37
4.4.60.0050.00211.37
4.4.50.0000.00811.37
4.4.40.0030.00311.37
4.4.30.0060.00211.37
4.4.20.0050.00511.37
4.4.10.0000.00711.37
4.4.00.0050.00311.37
4.3.110.0080.00011.37
4.3.100.0040.00411.37
4.3.90.0060.00411.37
4.3.80.0060.00311.37
4.3.70.0030.00311.37
4.3.60.0040.00411.37
4.3.50.0030.00311.37
4.3.40.0000.00611.37
4.3.30.0060.00011.37
4.3.20.0040.00211.37
4.3.10.0000.00611.37
4.3.00.0060.00011.37

preferences:
171.88 ms | 403 KiB | 5 Q