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($col); if($maxCol < $sum) { $maxCol = $sum; $fromMaxCow = $key + 1; } } echo "Max row is $fromMaxRow with $maxRow sum \n"; echo "Max col is $fromMaxCol with $maxCol sum \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.3.60.0100.01016.88
8.3.50.0090.00922.05
8.3.40.0040.01118.79
8.3.30.0070.00718.84
8.3.20.0040.00420.16
8.3.10.0060.00323.66
8.3.00.0040.00719.38
8.2.180.0040.01118.79
8.2.170.0070.00722.96
8.2.160.0070.00720.40
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0060.00317.75
8.2.120.0040.00426.35
8.2.110.0030.00620.56
8.2.100.0000.01117.97
8.2.90.0080.00019.21
8.2.80.0050.00317.97
8.2.70.0030.00517.75
8.2.60.0080.00018.04
8.2.50.0050.00318.07
8.2.40.0040.00419.16
8.2.30.0040.00420.69
8.2.20.0030.00617.79
8.2.10.0050.00318.12
8.2.00.0030.00618.22
8.1.280.0110.00325.92
8.1.270.0060.00323.92
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0030.00623.95
8.1.230.0060.00620.84
8.1.220.0080.00017.77
8.1.210.0000.00918.77
8.1.200.0090.00017.36
8.1.190.0050.00317.23
8.1.180.0000.00818.10
8.1.170.0040.00418.40
8.1.160.0000.00722.07
8.1.150.0050.00318.90
8.1.140.0030.00619.50
8.1.130.0030.00517.71
8.1.120.0050.00317.31
8.1.110.0040.00417.34
8.1.100.0040.00417.50
8.1.90.0070.00017.36
8.1.80.0060.00317.48
8.1.70.0000.00717.51
8.1.60.0050.00217.59
8.1.50.0000.00817.54
8.1.40.0080.00017.50
8.1.30.0030.00517.49
8.1.20.0040.00417.56
8.1.10.0000.00717.50
8.1.00.0030.00617.48
8.0.300.0040.00418.84
8.0.290.0000.00816.88
8.0.280.0040.00418.46
8.0.270.0000.00717.16
8.0.260.0000.00917.27
8.0.250.0070.00017.00
8.0.240.0030.00317.03
8.0.230.0050.00216.89
8.0.220.0040.00416.93
8.0.210.0000.00716.94
8.0.200.0000.00716.92
8.0.190.0030.00516.92
8.0.180.0040.00417.02
8.0.170.0000.00816.94
8.0.160.0080.00017.00
8.0.150.0030.00716.94
8.0.140.0030.00416.92
8.0.130.0050.00013.45
8.0.120.0040.00416.91
8.0.110.0040.00416.89
8.0.100.0030.00517.01
8.0.90.0040.00316.98
8.0.80.0070.00716.95
8.0.70.0070.00016.99
8.0.60.0000.00816.80
8.0.50.0000.00716.99
8.0.30.0080.01016.98
8.0.20.0130.00817.40
8.0.10.0040.00416.96
8.0.00.0090.00816.64
7.4.330.0020.00216.89
7.4.320.0030.00316.61
7.4.300.0060.00016.51
7.4.290.0070.00016.46
7.4.280.0000.00816.50
7.4.270.0030.00316.65
7.4.260.0060.00316.45
7.4.250.0040.00416.48
7.4.240.0020.00516.47
7.4.230.0030.00316.58
7.4.220.0130.01216.59
7.4.210.0140.00616.63
7.4.200.0030.00316.40
7.4.160.0040.01116.42
7.4.150.0090.01617.40
7.4.140.0120.00917.86
7.4.130.0090.01016.56
7.4.120.0120.00516.68
7.4.110.0060.01216.61
7.4.100.0030.01516.55
7.4.90.0150.00416.62
7.4.80.0030.01519.39
7.4.70.0130.00316.73
7.4.60.0060.01016.52
7.4.50.0040.01116.61
7.4.40.0080.00816.39
7.4.30.0130.00516.20
7.4.00.0060.00615.22
7.3.330.0040.00413.32
7.3.320.0030.00313.13
7.3.310.0000.00716.36
7.3.300.0000.00716.41
7.3.290.0070.00716.38
7.3.280.0070.01016.39
7.3.270.0130.00917.40
7.3.260.0100.00716.44
7.3.250.0150.00516.36
7.3.240.0080.00916.55
7.3.230.0040.01316.48
7.3.210.0070.01016.43
7.3.200.0030.01316.40
7.3.190.0150.02116.40
7.3.180.0170.00016.46
7.3.170.0090.00816.55
7.3.160.0090.00916.51
7.2.330.0030.01616.78
7.2.320.0090.00916.48
7.2.310.0110.00616.91
7.2.300.0110.00816.82
7.2.290.0090.00916.82
7.2.60.0060.00916.97
7.2.00.0240.00619.43
7.1.200.0060.00915.81
7.1.100.0000.01118.01
7.1.70.0000.00917.28
7.1.60.0030.01619.36
7.1.50.0120.00617.02
7.1.00.0030.07322.44
7.0.200.0040.00416.67
7.0.60.0030.04019.97
7.0.50.0000.04317.88
7.0.40.0030.05320.11
7.0.30.0470.06720.13
7.0.20.0270.05020.19
7.0.10.0100.08320.19
7.0.00.0070.06720.04
5.6.280.0000.05021.00
5.6.210.0070.04320.67
5.6.200.0000.06718.19
5.6.190.0070.06720.57
5.6.180.0330.07320.61
5.6.170.0200.05720.48
5.6.160.0070.04020.27
5.6.150.0030.06318.15
5.6.140.0030.05318.14
5.6.130.0000.07018.07
5.6.120.0100.08321.05
5.6.110.0170.06021.03
5.6.100.0130.08020.99
5.6.90.0100.08021.02
5.6.80.0070.07720.38
5.5.350.0230.07720.35
5.5.340.0000.05317.95
5.5.330.0030.07320.37
5.5.320.0130.06320.34
5.5.310.0300.07720.26
5.5.300.0100.05017.89
5.5.290.0130.06017.92
5.5.280.0070.08720.97
5.5.270.0070.04020.96
5.5.260.0070.08020.80
5.5.250.0030.07320.49
5.5.240.0300.07320.04

preferences:
49.42 ms | 401 KiB | 5 Q