3v4l.org

run code in 300+ PHP versions simultaneously
<?php //да се намерят реда и колоната с най-голяма стойност $arr = [ [1, 4, 7,10], [2, 5, 8,11], [3, 6, 9,12], [13,14,15,16] ]; $maxRow = 0; $maxCol = 0; $fromMaxRow = 0; $fromMaxCol = 0; $cols = []; foreach($arr as $keyRow => $row) { $sum = array_sum($row); if($maxRow < $sum) { $maxRow = $sum; $fromMaxRow = $keyRow + 1; } foreach($row as $keyCell => $cell) { $cols[$key][] = $cell; } } foreach ($cols as $key => $col) { $sum = array_sum($cow); if($maxCol < $sum) { $maxCol = $sum; $fromMaxCow = $key + 1; } } echo "Max row is $fromMaxRow with $maxRow sum"; echo "Max col is $fromMaxCol with $maxCol sum";

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.0090.01216.63
8.3.50.0100.00821.99
8.3.40.0140.00018.76
8.3.30.0090.00618.76
8.3.20.0040.00420.34
8.3.10.0040.00423.69
8.3.00.0080.00319.25
8.2.180.0080.00818.41
8.2.170.0100.01022.96
8.2.160.0110.00420.38
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00617.75
8.2.120.0080.00026.35
8.2.110.0030.00620.38
8.2.100.0060.00618.05
8.2.90.0050.00219.17
8.2.80.0030.00517.97
8.2.70.0000.00817.50
8.2.60.0040.00418.04
8.2.50.0050.00318.07
8.2.40.0060.00319.31
8.2.30.0000.00720.51
8.2.20.0080.00017.82
8.2.10.0050.00218.00
8.2.00.0000.00718.13
8.1.280.0160.00325.92
8.1.270.0110.00023.92
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0060.00322.18
8.1.230.0100.00017.79
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.38
8.1.190.0080.00017.38
8.1.180.0000.00718.10
8.1.170.0000.00918.66
8.1.160.0000.00722.06
8.1.150.0070.00018.75
8.1.140.0040.00419.64
8.1.130.0030.00317.65
8.1.120.0000.00917.46
8.1.110.0000.00817.35
8.1.100.0030.00517.45
8.1.90.0040.00417.43
8.1.80.0020.00517.31
8.1.70.0000.00717.46
8.1.60.0000.00717.63
8.1.50.0050.00317.43
8.1.40.0040.00417.41
8.1.30.0040.00417.60
8.1.20.0080.00017.47
8.1.10.0000.00717.61
8.1.00.0000.00817.46
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.35
8.0.270.0030.00317.26
8.0.260.0000.00917.21
8.0.250.0000.00716.86
8.0.240.0030.00316.89
8.0.230.0000.00716.93
8.0.220.0000.00916.84
8.0.210.0000.00716.79
8.0.200.0030.00317.02
8.0.190.0050.00317.01
8.0.180.0050.00317.02
8.0.170.0040.00416.96
8.0.160.0020.00516.83
8.0.150.0000.00916.93
8.0.140.0030.00316.91
8.0.130.0030.00313.46
8.0.120.0040.00416.92
8.0.110.0040.00416.96
8.0.100.0040.00416.99
8.0.90.0050.00316.91
8.0.80.0060.00916.90
8.0.70.0080.00016.94
8.0.60.0080.00017.02
8.0.50.0030.00617.02
8.0.30.0130.00317.09
8.0.20.0100.01017.40
8.0.10.0040.00417.04
8.0.00.0070.00916.65
7.4.330.0060.00016.82
7.4.320.0000.00716.63
7.4.300.0000.00616.60
7.4.290.0080.00016.50
7.4.280.0030.00516.35
7.4.270.0000.00716.53
7.4.260.0090.00316.64
7.4.250.0040.00416.55
7.4.240.0040.00416.48
7.4.230.0070.00016.50
7.4.220.0060.01316.55
7.4.210.0060.00816.40
7.4.200.0000.00716.59
7.4.160.0050.01116.52
7.4.150.0110.00717.40
7.4.140.0070.01417.86
7.4.130.0050.01216.48
7.4.120.0050.01316.54
7.4.110.0080.01116.46
7.4.100.0080.00816.63
7.4.90.0110.00716.58
7.4.80.0130.00619.39
7.4.70.0050.01116.31
7.4.60.0120.00916.62
7.4.50.0100.00316.63
7.4.40.0070.01116.40
7.4.30.0110.01416.54
7.4.10.0100.00615.29
7.4.00.0070.00615.14
7.3.330.0000.00813.23
7.3.320.0000.00513.22
7.3.310.0030.00316.29
7.3.300.0030.00316.41
7.3.290.0080.00816.37
7.3.280.0110.00716.37
7.3.270.0120.00617.40
7.3.260.0080.00816.50
7.3.250.0090.01216.36
7.3.240.0140.00616.40
7.3.230.0060.01016.43
7.3.210.0130.00416.43
7.3.200.0120.00616.51
7.3.190.0230.00016.59
7.3.180.0040.01216.45
7.3.170.0060.01116.49
7.3.160.0090.01416.36
7.3.130.0130.00714.82
7.3.120.0080.01014.94
7.3.110.0090.00614.92
7.3.100.0080.00714.90
7.3.90.0030.01214.94
7.3.80.0090.00614.86
7.3.70.0070.00514.97
7.3.60.0070.00714.85
7.3.50.0050.00814.95
7.3.40.0040.01014.70
7.3.30.0040.01114.69
7.3.20.0070.00916.87
7.3.10.0070.00416.63
7.3.00.0060.00816.65
7.2.330.0090.00916.73
7.2.320.0160.01016.57
7.2.310.0110.00616.86
7.2.300.0090.00916.49
7.2.290.0060.01116.79
7.2.260.0070.01015.04
7.2.250.0050.01214.99
7.2.240.0030.01215.15
7.2.230.0050.01215.11
7.2.220.0060.01015.00
7.2.210.0040.00815.12
7.2.200.0060.00915.11
7.2.190.0050.01014.96
7.2.180.0060.00714.91
7.2.170.0070.00615.11
7.2.160.0080.00715.02
7.2.150.0060.00617.00
7.2.140.0050.00517.13
7.2.130.0050.00816.94
7.2.120.0050.00616.98
7.2.110.0080.00716.91
7.2.100.0070.00516.90
7.2.90.0060.00616.93
7.2.80.0040.00616.88
7.2.70.0050.00916.96
7.2.60.0090.01016.83
7.2.50.0050.00616.73
7.2.40.0060.00716.96
7.2.30.0060.00816.85
7.2.20.0040.00816.90
7.2.10.0090.00516.99
7.2.00.0040.00816.95
7.1.330.0020.01415.79
7.1.320.0080.01115.94
7.1.310.0040.00915.71
7.1.300.0050.00815.76
7.1.290.0080.00415.86
7.1.280.0050.00715.81
7.1.270.0050.00815.80
7.1.260.0050.00515.53
7.1.250.0080.00315.73
7.1.240.0060.00515.84
7.1.230.0050.00815.84
7.1.220.0060.00515.76
7.1.210.0080.00415.81
7.1.200.0050.00515.71
7.1.190.0070.00515.78
7.1.180.0030.01015.85
7.1.170.0050.00615.85
7.1.160.0050.00415.69
7.1.150.0030.01015.78
7.1.140.0040.00915.85
7.1.130.0040.00915.81
7.1.120.0030.00915.72
7.1.110.0100.00315.78
7.1.100.0060.00715.88
7.1.90.0060.00415.95
7.1.80.0050.00715.88
7.1.70.0060.00716.06
7.1.60.0030.00816.76
7.1.50.0070.00916.05
7.1.40.0070.00715.85
7.1.30.0040.01115.84
7.1.20.0070.00715.77
7.1.10.0080.00515.80
7.1.00.0050.02417.38
7.0.330.0050.00515.37
7.0.320.0030.00815.44
7.0.310.0010.00915.37
7.0.300.0050.00815.27
7.0.290.0040.00815.50
7.0.280.0060.00715.44
7.0.270.0030.00815.47
7.0.260.0070.00415.27
7.0.250.0050.00915.58
7.0.240.0030.00615.41
7.0.230.0050.00815.42
7.0.220.0030.00615.47
7.0.210.0060.00715.46
7.0.200.0030.00915.75
7.0.190.0060.00715.33
7.0.180.0080.00515.46
7.0.170.0050.00515.45
7.0.160.0030.00815.47
7.0.150.0020.01115.27
7.0.140.0090.00615.35
7.0.130.0040.00715.48
7.0.120.0070.00515.51
7.0.110.0060.00815.41
7.0.100.0040.01015.35
7.0.90.0020.01115.40
7.0.80.0070.00615.50
7.0.70.0090.00615.48
7.0.60.0060.01516.52
7.0.50.0050.01416.08
7.0.40.0070.01815.17
7.0.30.0150.02415.15
7.0.20.0100.02815.06
7.0.10.0030.03015.20
7.0.00.0090.02415.09
5.6.400.0070.00714.56
5.6.390.0070.00614.65
5.6.380.0040.00714.68
5.6.370.0070.00614.50
5.6.360.0070.00614.52
5.6.350.0030.00914.40
5.6.340.0110.00414.65
5.6.330.0030.01014.44
5.6.320.0020.01114.47
5.6.310.0070.00614.31
5.6.300.0080.00514.55
5.6.290.0080.00614.42
5.6.280.0030.02116.08
5.6.270.0030.01014.33
5.6.260.0080.00514.53
5.6.250.0060.00614.51
5.6.240.0060.00814.38
5.6.230.0080.00514.27
5.6.220.0060.00714.42
5.6.210.0050.01515.92
5.6.200.0070.02515.46
5.6.190.0050.02816.04
5.6.180.0110.02616.02
5.6.170.0090.01615.94
5.6.160.0080.02215.91
5.6.150.0070.01415.47
5.6.140.0100.02415.39
5.6.130.0040.02115.43
5.6.120.0050.01916.19
5.6.110.0070.02716.07
5.6.100.0030.02816.15
5.6.90.0080.02816.10
5.6.80.0070.02215.85
5.6.70.0050.00514.37
5.6.60.0050.00814.46
5.6.50.0020.01214.28
5.6.40.0080.00614.45
5.6.30.0070.00714.38
5.6.20.0050.00514.43
5.6.10.0070.00614.43
5.6.00.0050.00914.28
5.5.380.0040.00713.35
5.5.370.0070.00313.16
5.5.360.0030.00813.38
5.5.350.0080.02815.06
5.5.340.0050.01514.56
5.5.330.0090.01915.07
5.5.320.0090.01915.06
5.5.310.0100.01515.09
5.5.300.0050.02614.48
5.5.290.0110.01514.46
5.5.280.0070.02615.12
5.5.270.0070.01515.28
5.5.260.0070.02315.19
5.5.250.0060.02415.22
5.5.240.0130.02115.12
5.5.230.0020.00913.40
5.5.220.0050.00713.28
5.5.210.0050.00713.41
5.5.200.0070.00613.38
5.5.190.0040.00813.35
5.5.180.0030.01013.34
5.5.170.0050.01013.19
5.5.160.0040.01013.31
5.5.150.0070.00713.29
5.5.140.0040.00813.34
5.5.130.0050.00513.18
5.5.120.0040.00813.26
5.5.110.0040.00913.28
5.5.100.0050.00613.35
5.5.90.0040.01013.14
5.5.80.0070.00513.39
5.5.70.0080.00513.22
5.5.60.0060.00513.27
5.5.50.0050.00713.18
5.5.40.0030.00713.25
5.5.30.0030.00613.27
5.5.20.0030.00813.41
5.5.10.0020.00713.28
5.5.00.0020.00913.27

preferences:
56.26 ms | 401 KiB | 5 Q