3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ 101 => 5, 109 => 100, 220 => 50, 231 => 45, 245 => 90 ]; $b = [ 'PRO' => 12, 'LOG' => 15, 'DEV' => 100 ]; $difference = 0; foreach ($a as &$minuend) { while ($minuend && ($b || $difference < 0)) { $suprahend = $difference < 0 ? -$difference : array_shift($b); $difference = $minuend - $suprahend; $minuend = max(0, $difference); } } var_export($a);

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.130.0120.00918.95
8.4.120.0050.00623.69
8.4.110.0120.00920.40
8.4.100.0140.00717.52
8.4.90.0100.00522.20
8.4.80.0150.00817.71
8.4.70.0070.00917.69
8.4.60.0100.01018.69
8.4.50.0060.00617.53
8.4.40.0030.00517.35
8.4.30.0030.00620.66
8.4.20.0140.00419.49
8.4.10.0120.00919.34
8.3.260.0040.00616.49
8.3.250.0070.01218.78
8.3.240.0100.00917.16
8.3.230.0120.00716.59
8.3.220.0110.00717.18
8.3.210.0070.00818.36
8.3.200.0050.00416.85
8.3.190.0040.00419.00
8.3.180.0090.00916.57
8.3.170.0070.00016.98
8.3.160.0110.00719.11
8.3.150.0150.00317.10
8.3.140.0000.00817.36
8.3.130.0000.00818.32
8.3.120.0030.00620.71
8.3.110.0000.01020.94
8.3.100.0100.00024.06
8.3.90.0110.00726.77
8.3.80.0040.00416.63
8.3.70.0160.00318.00
8.3.60.0140.00716.63
8.3.50.0130.00618.18
8.3.40.0040.01119.22
8.3.30.0080.01218.85
8.3.20.0120.00324.18
8.3.10.0100.01024.66
8.3.00.0040.00426.16
8.2.290.0140.00520.54
8.2.280.0140.00518.07
8.2.270.0130.00616.60
8.2.260.0180.00019.03
8.2.250.0000.00916.58
8.2.240.0040.00417.11
8.2.230.0080.00022.58
8.2.220.0030.00637.54
8.2.210.0070.01026.77
8.2.200.0090.00016.38
8.2.190.0110.00716.58
8.2.180.0040.01125.92
8.2.170.0150.00319.14
8.2.160.0130.00022.96
8.2.150.0110.00325.66
8.2.140.0030.00624.66
8.2.130.0040.01126.16
8.2.120.0040.00419.39
8.2.110.0060.00322.20
8.2.100.0060.00617.91
8.2.90.0000.00817.63
8.2.80.0000.00818.82
8.2.70.0060.00617.75
8.2.60.0040.00417.93
8.2.50.0030.00518.07
8.2.40.0060.00318.04
8.2.30.0040.00418.11
8.2.20.0000.00719.49
8.2.10.0080.00017.80
8.2.00.0000.00719.31
8.1.330.0100.00921.86
8.1.320.0140.00515.84
8.1.310.0030.00616.44
8.1.300.0130.00617.52
8.1.290.0090.00018.88
8.1.280.0100.00725.92
8.1.270.0040.00423.99
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00423.77
8.1.230.0000.01117.83
8.1.220.0000.00817.78
8.1.210.0050.00318.77
8.1.200.0100.00017.23
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0050.00318.62
8.1.160.0070.00018.88
8.1.150.0040.00418.55
8.1.140.0070.00317.41
8.1.130.0000.00817.39
8.1.120.0030.00317.40
8.1.110.0000.00717.45
8.1.100.0040.00417.51
8.1.90.0030.00317.52
8.1.80.0000.00817.48
8.1.70.0000.00717.48
8.1.60.0060.00317.62
8.1.50.0100.00017.49
8.1.40.0000.00717.49
8.1.30.0000.00817.64
8.1.20.0050.00317.65
8.1.10.0000.00717.40
8.1.00.0070.00317.41
8.0.300.0000.00718.77
8.0.290.0000.00816.88
8.0.280.0070.00018.45
8.0.270.0070.00017.99
8.0.260.0000.00716.94
8.0.250.0030.00516.95
8.0.240.0060.00016.91
8.0.230.0000.00717.05
8.0.220.0000.00716.98
8.0.210.0070.00017.00
8.0.200.0000.00717.03
8.0.190.0080.00017.02
8.0.180.0040.00417.00
8.0.170.0080.00016.88
8.0.160.0080.00016.82
8.0.150.0000.00716.95
8.0.140.0030.00316.95
8.0.130.0000.00513.47
8.0.120.0000.00716.90
8.0.110.0050.00216.82
8.0.100.0070.00016.75
8.0.90.0030.00616.94
8.0.80.0000.00816.88
8.0.70.0000.00816.94
8.0.60.0030.00616.83
8.0.50.0030.00616.91
8.0.30.0030.00516.91
8.0.20.0060.00316.94
8.0.10.0040.00417.01
8.0.00.0000.00717.07
7.4.330.0020.00215.55
7.4.320.0070.00016.51
7.4.300.0000.00716.41
7.4.290.0040.00416.37
7.4.280.0040.00416.48
7.4.270.0000.00716.55
7.4.260.0000.00613.29
7.4.250.0000.00716.42
7.4.240.0080.00016.54
7.4.230.0040.00416.48
7.4.220.0040.00416.47
7.4.210.0040.00416.46
7.4.200.0000.00616.45
7.4.190.0080.00016.64
7.4.180.0050.00316.53
7.4.160.0030.00316.58
7.4.150.0040.00416.33
7.4.140.0080.00016.32
7.4.130.0000.00716.35
7.4.120.0000.00716.49
7.4.110.0040.00416.30
7.4.100.0000.00716.52
7.4.90.0030.00516.44
7.4.80.0040.00416.32
7.4.70.0040.00416.48
7.4.60.0040.00416.35
7.4.50.0040.00416.34
7.4.40.0000.00816.44
7.4.30.0030.00316.55
7.4.20.0070.00016.33
7.4.10.0040.00316.53
7.4.00.0040.00416.49
7.3.330.0030.00316.18
7.3.320.0000.00513.16
7.3.310.0040.00416.36
7.3.300.0040.00416.35
7.3.290.0070.00016.36
7.3.280.0040.00416.25
7.3.270.0040.00416.25
7.3.260.0030.00316.14
7.3.250.0070.00016.32
7.3.240.0000.00716.36
7.3.230.0030.00316.14
7.3.220.0080.00016.09
7.3.210.0000.00716.05
7.3.200.0030.00316.15
7.3.190.0080.00016.05
7.3.180.0070.00016.15
7.3.170.0000.00716.19
7.3.160.0000.00916.19
7.3.150.0000.00816.21
7.3.140.0040.00416.15
7.3.130.0030.00616.25
7.3.120.0000.00816.29
7.3.110.0040.00416.23
7.3.100.0000.00716.04
7.3.90.0040.00416.54
7.3.80.0070.00016.32
7.3.70.0000.00716.30
7.3.60.0030.00316.41
7.3.50.0080.00016.37
7.3.40.0000.00716.40
7.3.30.0070.00016.27
7.3.20.0060.00616.38
7.3.10.0000.00816.39
7.3.00.0040.00416.42

preferences:
29.17 ms | 403 KiB | 5 Q