3v4l.org

run code in 500+ PHP versions simultaneously
<?php $time_start = [ 0 => '22:00:00', 1 => '03:00:00', ]; $time_end = [ 0 => '02:00:00', 1 => '08:00:00', ]; $logs = [ 0 => '2019-07-09 22:00:00', 1 => '2019-07-10 02:00:00', 2 => '2019-07-10 03:00:00', 3 => '2019-07-10 08:00:00', ]; $time = []; $diff = 0; for ($j = 0; $j < count($logs); $j = $j + 2) { $attendance_start = date("Y-m-d", strtotime($logs[$j])); $attendance_end = date("Y-m-d", strtotime($logs[$j + 1])); for ($i = 0; $i < count($time_start); $i++) { $time_starts = date('Y-m-d H:i:s', strtotime("$attendance_start " . $time_start[$i] . "")); $time_ends = date('Y-m-d H:i:s', strtotime("$attendance_end " . $time_end[$i] . "")); if ($logs[$j] >= $time_starts && $logs[$j + 1] <= $time_ends) { array_push($time, $logs[$j], $logs[$j + 1]); $diff += (round((strtotime($logs[$j + 1]) - strtotime($logs[$j])) / 3600, 1)); break; } } } echo $diff . " Hours";die;

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.30.0040.00417.28
8.5.20.0090.00819.40
8.5.10.0120.00616.78
8.5.00.0110.01120.20
8.4.180.0120.00922.14
8.4.170.0040.00724.00
8.4.160.0120.01222.25
8.4.150.0090.00317.95
8.4.140.0120.00917.86
8.4.130.0120.01018.04
8.4.120.0110.00822.05
8.4.110.0140.00718.90
8.4.100.0080.00517.99
8.4.90.0140.00618.21
8.4.80.0090.00818.27
8.4.70.0110.01119.83
8.4.60.0140.00718.01
8.4.50.0150.00520.49
8.4.40.0160.00320.59
8.4.30.0160.00324.00
8.4.20.0040.01619.07
8.4.10.0160.00317.81
8.3.300.0100.01120.91
8.3.290.0100.01220.91
8.3.280.0090.01118.59
8.3.270.0100.00916.66
8.3.260.0080.01117.00
8.3.250.0150.00318.94
8.3.240.0110.00816.70
8.3.230.0110.00916.67
8.3.220.0060.00717.54
8.3.210.0120.00416.99
8.3.200.0120.00716.73
8.3.190.0130.00617.42
8.3.180.0110.00818.69
8.3.170.0030.00619.21
8.3.160.0130.00618.72
8.3.150.0160.00320.75
8.3.140.0100.00016.94
8.3.130.0100.00718.79
8.3.120.0050.00520.75
8.3.110.0060.00318.50
8.3.100.0060.00320.46
8.3.90.0110.00716.65
8.3.80.0030.00717.97
8.3.70.0060.00916.88
8.3.60.0040.01118.43
8.3.50.0190.01316.65
8.3.40.0090.00619.16
8.3.30.0140.00018.96
8.3.20.0070.00021.76
8.3.10.0040.00422.09
8.3.00.0000.00823.65
8.2.300.0120.00820.37
8.2.290.0130.00620.49
8.2.280.0050.00418.63
8.2.270.0110.00017.27
8.2.260.0040.00416.73
8.2.250.0060.00318.54
8.2.240.0030.00617.30
8.2.230.0040.00420.94
8.2.220.0050.00324.06
8.2.210.0080.00026.77
8.2.200.0030.00718.29
8.2.190.0130.01318.54
8.2.180.0070.01417.00
8.2.170.0040.01122.96
8.2.160.0030.01021.13
8.2.150.0000.00924.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00826.16
8.2.110.0030.00719.36
8.2.100.0080.00418.16
8.2.90.0050.00519.32
8.2.80.0080.00018.05
8.2.70.0050.00518.05
8.2.60.0030.00518.34
8.2.50.0040.00418.10
8.2.40.0040.00419.46
8.2.30.0040.00419.27
8.2.20.0030.00518.25
8.2.10.0040.00419.38
8.2.00.0030.00619.39
8.1.340.0130.00721.75
8.1.330.0110.00818.30
8.1.320.0100.01016.50
8.1.310.0130.00716.72
8.1.300.0070.01120.33
8.1.290.0090.00018.88
8.1.280.0110.00425.92
8.1.270.0080.00023.87
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00020.96
8.1.230.0040.00820.86
8.1.220.0090.00017.89
8.1.210.0080.00018.77
8.1.200.0030.00617.60
8.1.190.0030.00817.38
8.1.180.0040.00418.10
8.1.170.0030.00518.84
8.1.160.0040.00419.02
8.1.150.0080.00018.88
8.1.140.0030.00520.79
8.1.130.0000.00720.15
8.1.120.0000.00717.55
8.1.110.0000.00917.67
8.1.100.0040.00417.72
8.1.90.0030.00517.63
8.1.80.0000.00817.52
8.1.70.0030.00317.57
8.1.60.0000.00917.72
8.1.50.0050.00317.70
8.1.40.0040.00417.61
8.1.30.0030.00717.76
8.1.20.0090.00017.79
8.1.10.0040.00417.72
8.1.00.0000.00717.57
8.0.300.0000.00721.77
8.0.290.0050.00317.00
8.0.280.0000.00718.59
8.0.270.0050.00317.38
8.0.260.0030.00321.72
8.0.250.0000.00717.25
8.0.240.0030.00317.19
8.0.230.0060.00317.12
8.0.220.0000.00717.20
8.0.210.0000.00817.17
8.0.200.0030.00317.15
8.0.190.0040.00417.23
8.0.180.0000.00817.11
8.0.170.0060.00317.18
8.0.160.0080.00017.20
8.0.150.0000.00817.14
8.0.140.0040.00417.16
8.0.130.0000.00613.59
8.0.120.0000.00717.16
8.0.110.0040.00417.13
8.0.100.0070.00017.26
8.0.90.0090.00017.04
8.0.80.0060.00917.20
8.0.70.0050.00217.08
8.0.60.0000.00817.18
8.0.50.0000.00817.23
8.0.30.0060.01317.19
8.0.20.0120.01017.28
8.0.10.0080.00017.39
8.0.00.0060.01216.91
7.4.330.0030.00315.55
7.4.320.0060.00016.78
7.4.300.0060.00016.80
7.4.290.0070.00016.57
7.4.280.0060.00316.69
7.4.270.0070.00016.71
7.4.260.0000.00716.68
7.4.250.0050.00316.72
7.4.240.0070.00016.72
7.4.230.0050.00316.51
7.4.220.0070.00016.81
7.4.210.0060.01116.58
7.4.200.0040.00316.78
7.4.130.0090.01216.82
7.4.120.0030.01316.60
7.4.110.0150.00316.76
7.4.100.0120.00416.82
7.4.90.0100.01016.52
7.4.80.0090.01419.39
7.4.70.0090.00916.70
7.4.60.0130.00316.80
7.4.50.0060.01016.46
7.4.40.0140.00316.91
7.4.00.0070.00715.07
7.3.330.0050.00013.32
7.3.320.0030.00313.41
7.3.310.0000.00716.41
7.3.300.0070.00016.52
7.3.290.0070.00016.38
7.3.280.0040.01116.50
7.3.260.0100.00816.70
7.3.240.0080.00916.67
7.3.230.0100.01016.68
7.3.210.0130.00316.62
7.3.200.0070.01016.72
7.3.190.0100.00616.60
7.3.180.0150.00016.70
7.3.170.0130.00616.64
7.3.160.0140.00316.74
7.3.70.0040.00814.87
7.3.60.0100.00514.97
7.3.50.0070.00515.01
7.3.40.0090.00514.56
7.3.30.0090.00514.89
7.3.20.0200.00514.98
7.3.10.0190.00214.94
7.3.00.0100.01014.94
7.2.330.0140.00316.74
7.2.320.0070.01016.75
7.2.310.0100.00716.66
7.2.300.0140.00316.53
7.2.290.0100.01416.92
7.2.200.0110.00915.22
7.2.190.0100.00815.12
7.2.180.0060.01315.16
7.2.170.0060.00814.93
7.2.160.0080.00615.17
7.2.150.0150.01015.12
7.2.140.0120.01215.28
7.2.130.0170.00515.21
7.2.120.0100.01015.23
7.2.110.0080.00815.18
7.2.100.0080.00715.25
7.2.90.0180.01315.32
7.2.80.0120.01015.20
7.2.70.0090.01115.26
7.2.60.0130.00915.26
7.2.50.0130.00915.11
7.2.40.0100.00715.27
7.2.30.0080.00915.19
7.2.20.0130.00915.37
7.2.10.0530.00715.19
7.2.00.0090.01115.31
7.1.300.0100.00714.17
7.1.290.0110.01214.06
7.1.280.0120.00713.93
7.1.270.0080.00614.06
7.1.260.0140.00513.97
7.1.250.0510.00814.17

preferences:
106.86 ms | 1422 KiB | 5 Q