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"; 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.40.0110.00418.85
8.3.30.0130.00318.83
8.3.20.0040.00420.20
8.3.10.0080.00023.66
8.3.00.0040.00719.37
8.2.170.0070.00722.96
8.2.160.0070.00720.45
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0090.00017.75
8.2.120.0040.00426.35
8.2.110.0030.00620.58
8.2.100.0080.00417.93
8.2.90.0000.00819.21
8.2.80.0050.00317.97
8.2.70.0090.00017.75
8.2.60.0080.00018.05
8.2.50.0040.00418.07
8.2.40.0080.00019.44
8.2.30.0000.00820.63
8.2.20.0040.00417.84
8.2.10.0000.00818.06
8.2.00.0080.00018.16
8.1.270.0030.00722.20
8.1.260.0080.00028.09
8.1.250.0050.00328.09
8.1.240.0090.00022.19
8.1.230.0080.00417.79
8.1.220.0000.00817.91
8.1.210.0040.00418.77
8.1.200.0000.00817.36
8.1.190.0000.00817.13
8.1.180.0040.00418.10
8.1.170.0050.00318.48
8.1.160.0020.00522.03
8.1.150.0040.00418.89
8.1.140.0000.00919.43
8.1.130.0000.00717.62
8.1.120.0040.00417.52
8.1.110.0000.00717.48
8.1.100.0050.00217.45
8.1.90.0020.00517.45
8.1.80.0000.00817.36
8.1.70.0070.00017.47
8.1.60.0040.00417.60
8.1.50.0000.00817.52
8.1.40.0050.00317.42
8.1.30.0060.00317.63
8.1.20.0080.00017.65
8.1.10.0000.00817.61
8.1.00.0050.00317.44
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0000.00718.36
8.0.270.0030.00317.32
8.0.260.0060.00317.18
8.0.250.0030.00317.02
8.0.240.0070.00017.04
8.0.230.0070.00016.98
8.0.220.0080.00016.85
8.0.210.0040.00416.98
8.0.200.0000.00617.00
8.0.190.0000.00717.02
8.0.180.0050.00217.03
8.0.170.0050.00216.96
8.0.160.0000.00816.87
8.0.150.0070.00316.86
8.0.140.0000.00816.80
8.0.130.0030.00313.46
8.0.120.0050.00316.96
8.0.110.0050.00316.89
8.0.100.0070.00016.84
8.0.90.0000.00817.07
8.0.80.0090.00616.92
8.0.70.0050.00217.00
8.0.60.0040.00416.81
8.0.50.0040.00416.86
8.0.30.0070.01416.98
8.0.20.0080.01117.40
8.0.10.0070.00016.91
8.0.00.0070.01016.75
7.4.330.0030.00316.69
7.4.320.0000.00716.56
7.4.300.0030.00316.59
7.4.290.0070.00016.49
7.4.280.0030.00616.64
7.4.270.0030.00316.46
7.4.260.0000.00916.61
7.4.250.0040.00416.54
7.4.240.0030.00416.57
7.4.230.0000.00716.54
7.4.220.0150.00716.51
7.4.210.0080.00916.59
7.4.200.0000.00716.63
7.4.160.0040.01116.42
7.4.150.0070.01117.40
7.4.140.0120.00617.86
7.4.130.0110.00816.45
7.4.120.0100.00816.58
7.4.110.0090.00916.60
7.4.100.0120.00616.51
7.4.90.0110.00616.55
7.4.80.0100.00619.39
7.4.70.0080.01216.62
7.4.60.0130.00316.54
7.4.50.0110.00416.34
7.4.40.0110.00616.77
7.4.30.0120.00616.43
7.4.10.0100.00715.22
7.4.00.0130.00314.95
7.3.330.0090.00013.24
7.3.320.0000.00513.23
7.3.310.0000.00616.32
7.3.300.0000.00716.45
7.3.290.0080.00816.40
7.3.280.0100.00616.42
7.3.270.0060.01217.40
7.3.260.0150.00316.37
7.3.250.0110.00816.51
7.3.240.0100.01216.48
7.3.230.0120.00416.50
7.3.210.0100.00716.32
7.3.200.0070.01416.49
7.3.190.0040.01416.39
7.3.180.0060.00916.27
7.3.170.0120.00816.64
7.3.160.0130.01016.33
7.3.130.0100.01015.00
7.3.120.0060.01314.89
7.3.110.0000.01714.83
7.3.100.0100.00614.86
7.3.90.0030.01215.01
7.3.80.0070.00314.61
7.3.70.0060.00914.69
7.3.60.0090.00614.98
7.3.50.0100.00314.85
7.3.40.0070.00714.66
7.3.30.0070.00714.83
7.3.20.0090.00316.82
7.3.10.0100.00316.46
7.3.00.0030.01316.78
7.2.330.0150.02616.45
7.2.320.0090.01216.75
7.2.310.0140.00316.50
7.2.300.0090.00916.48
7.2.290.0000.02116.66
7.2.260.0100.00714.95
7.2.250.0060.00915.23
7.2.240.0000.01514.92
7.2.230.0060.01315.06
7.2.220.0000.01815.20
7.2.210.0030.00714.86
7.2.200.0060.01014.67
7.2.190.0090.00615.15
7.2.180.0030.01415.16
7.2.170.0070.00415.09
7.2.160.0000.01415.16
7.2.150.0030.01017.11
7.2.140.0090.00617.02
7.2.130.0000.01016.71
7.2.120.0060.01216.90
7.2.110.0090.00616.87
7.2.100.0100.00616.90
7.2.90.0060.00916.81
7.2.80.0090.00617.03
7.2.70.0030.00616.76
7.2.60.0050.01017.02
7.2.50.0040.00816.72
7.2.40.0040.01516.99
7.2.30.0000.01216.89
7.2.20.0000.01517.15
7.2.10.0080.00816.93
7.2.00.0190.00818.00
7.1.330.0120.00315.78
7.1.320.0060.00915.79
7.1.310.0030.01015.99
7.1.300.0070.01015.87
7.1.290.0030.01015.99
7.1.280.0090.00315.93
7.1.270.0040.01115.87
7.1.260.0030.01015.99
7.1.250.0060.00615.70
7.1.240.0000.01615.78
7.1.230.0070.01015.96
7.1.220.0030.00715.82
7.1.210.0030.00715.80
7.1.200.0070.00615.75
7.1.190.0070.00315.49
7.1.180.0050.00515.78
7.1.170.0000.01515.95
7.1.160.0070.00715.48
7.1.150.0030.01015.91
7.1.140.0040.01115.96
7.1.130.0070.00715.96
7.1.120.0090.00315.73
7.1.110.0000.00816.00
7.1.100.0070.00716.91
7.1.90.0000.01116.06
7.1.80.0040.00815.78
7.1.70.0040.00716.61
7.1.60.0060.01017.68
7.1.50.0070.01116.39
7.1.40.0080.00015.83
7.1.30.0070.00715.84
7.1.20.0070.00715.96
7.1.10.0060.00915.79
7.1.00.0030.04219.22
7.0.330.0060.00615.11
7.0.320.0060.00615.57
7.0.310.0170.00015.37
7.0.300.0120.00015.21
7.0.290.0030.00715.40
7.0.280.0100.00315.53
7.0.270.0030.01015.38
7.0.260.0060.00615.54
7.0.250.0060.00615.37
7.0.240.0030.01315.51
7.0.230.0060.00315.40
7.0.220.0000.01415.44
7.0.210.0160.00015.56
7.0.200.0040.00616.10
7.0.190.0070.00715.36
7.0.180.0030.01215.14
7.0.170.0070.00715.63
7.0.160.0100.00315.46
7.0.150.0080.00015.33
7.0.140.0050.00515.18
7.0.130.0040.00415.57
7.0.120.0060.00915.50
7.0.110.0030.00915.38
7.0.100.0030.01015.24
7.0.90.0090.00315.41
7.0.80.0090.00315.52
7.0.70.0060.01015.25
7.0.60.0100.04417.66
7.0.50.0040.02416.81
7.0.40.0030.03316.79
7.0.30.0150.04316.72
7.0.20.0170.03716.79
7.0.10.0050.02816.79
7.0.00.0120.03816.82
5.6.400.0070.00714.66
5.6.390.0040.00714.67
5.6.380.0040.01214.30
5.6.370.0100.00314.33
5.6.360.0030.01314.42
5.6.350.0000.00914.68
5.6.340.0030.01014.24
5.6.330.0120.00314.68
5.6.320.0060.00614.25
5.6.310.0070.00714.27
5.6.300.0000.00914.37
5.6.290.0060.00814.38
5.6.280.0080.00414.66
5.6.270.0060.00914.43
5.6.260.0070.01014.60
5.6.250.0000.01114.62
5.6.240.0070.00414.56
5.6.230.0060.00914.38
5.6.220.0030.00714.27
5.6.210.0060.04217.58
5.6.200.0070.03516.46
5.6.190.0050.04717.56
5.6.180.0200.03817.36
5.6.170.0150.04217.37
5.6.160.0020.03817.43
5.6.150.0080.02616.31
5.6.140.0030.03116.22
5.6.130.0080.03016.26
5.6.120.0100.02417.71
5.6.110.0080.04417.93
5.6.100.0050.04817.68
5.6.90.0080.04317.81
5.6.80.0090.02817.49
5.6.70.0030.01414.50
5.6.60.0040.01114.45
5.6.50.0030.01414.72
5.6.40.0070.00714.45
5.6.30.0060.00914.29
5.6.20.0070.00714.40
5.6.10.0100.00714.37
5.6.00.0060.01214.33
5.5.380.0030.00714.70
5.5.370.0000.01314.69
5.5.360.0000.01414.37
5.5.350.0100.02817.52
5.5.340.0050.02316.34
5.5.330.0100.03717.27
5.5.320.0170.04217.48
5.5.310.0100.04017.38
5.5.300.0060.04016.01
5.5.290.0050.05116.02
5.5.280.0050.02317.53
5.5.270.0070.03817.58
5.5.260.0030.04517.68
5.5.250.0020.03017.48
5.5.240.0190.03317.16
5.5.230.0100.00714.43
5.5.220.0120.00614.25
5.5.210.0090.00614.27
5.5.200.0000.01614.47
5.5.190.0030.01314.55
5.5.180.0030.01014.34
5.5.170.0090.00614.13
5.5.160.0030.01014.25
5.5.150.0060.00914.41
5.5.140.0090.00614.38
5.5.130.0040.01114.65
5.5.120.0030.01314.38
5.5.110.0040.01214.34
5.5.100.0100.00614.44
5.5.90.0160.00014.62
5.5.80.0120.00014.21
5.5.70.0030.00714.07
5.5.60.0000.01014.37
5.5.50.0070.00713.93
5.5.40.0070.00714.27
5.5.30.0100.00313.95
5.5.20.0090.00614.39
5.5.10.0080.00614.49
5.5.00.0060.00914.46

preferences:
46.73 ms | 400 KiB | 5 Q