3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ [15, 16, 8, 1], [2, 3, 4, 7], [9, 11, 19, 6] ]; function bubbleSortRowCol($arr) { $cols = []; foreach($arr as $row) { bubbleSort($row); } } function bubbleSort($arr) { $sorted = false; while (false === $sorted) { $sorted = true; for ($i = 0; $i < count($arr)-1; ++$i) { $current = $arr[$i]; $next = $arr[$i+1]; if ($next < $current) { $arr[$i] = $next; $arr[$i+1] = $current; $sorted = false; } } } return $arr; } print_r(bubbleSortColRow($arr));

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.0070.00718.78
8.3.30.0090.00618.51
8.3.20.0000.00720.29
8.3.10.0000.00823.61
8.3.00.0050.00320.03
8.2.170.0100.01022.96
8.2.160.0040.01120.43
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00420.92
8.2.120.0060.00326.35
8.2.110.0030.00620.38
8.2.100.0090.00317.90
8.2.90.0000.00819.18
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0000.00821.07
8.2.30.0040.00420.57
8.2.20.0020.00517.73
8.2.10.0000.00818.08
8.2.00.0000.00718.06
8.1.270.0000.00818.88
8.1.260.0050.00228.09
8.1.250.0080.00028.09
8.1.240.0050.00523.99
8.1.230.0060.00617.53
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0030.00717.22
8.1.190.0060.00317.11
8.1.180.0030.00618.10
8.1.170.0040.00418.59
8.1.160.0040.00420.69
8.1.150.0030.00618.84
8.1.140.0050.00319.45
8.1.130.0000.00717.56
8.1.120.0000.00717.44
8.1.110.0040.00417.32
8.1.100.0040.00417.31
8.1.90.0030.00617.46
8.1.80.0000.00717.45
8.1.70.0040.00417.41
8.1.60.0110.00017.42
8.1.50.0060.00317.45
8.1.40.0080.00017.59
8.1.30.0040.00417.56
8.1.20.0000.00817.72
8.1.10.0000.00817.47
8.1.00.0000.00817.49
8.0.300.0070.00018.77
8.0.290.0040.00416.75
8.0.280.0040.00418.32
8.0.270.0000.00717.26
8.0.260.0000.00617.13
8.0.250.0000.00717.00
8.0.240.0000.00716.87
8.0.230.0000.00716.87
8.0.220.0040.00416.80
8.0.210.0000.00816.88
8.0.200.0060.00016.84
8.0.190.0000.00717.03
8.0.180.0040.00416.95
8.0.170.0040.00416.86
8.0.160.0000.00717.03
8.0.150.0070.00316.91
8.0.140.0050.00216.76
8.0.130.0050.00013.32
8.0.120.0000.00716.84
8.0.110.0000.00716.94
8.0.100.0040.00316.91
8.0.90.0040.00416.79
8.0.80.0070.01116.92
8.0.70.0000.00716.78
8.0.60.0000.00716.91
8.0.50.0030.00316.76
8.0.30.0130.00717.11
8.0.20.0100.01117.40
8.0.10.0030.00317.08
8.0.00.0100.01116.87
7.4.330.0070.00015.08
7.4.320.0000.00616.46
7.4.300.0000.00616.44
7.4.290.0070.00016.63
7.4.280.0070.00016.63
7.4.270.0030.00316.54
7.4.260.0110.00016.48
7.4.250.0040.00416.46
7.4.240.0040.00316.49
7.4.230.0070.00016.61
7.4.220.0070.01016.51
7.4.210.0090.00616.61
7.4.200.0040.00416.62
7.4.160.0090.00616.55
7.4.150.0140.00417.40
7.4.140.0100.01017.86
7.4.130.0090.01116.49
7.4.120.0100.00716.56
7.4.110.0120.00816.45
7.4.100.0120.00616.32
7.4.90.0090.00916.45
7.4.80.0040.01619.39
7.4.70.0100.00616.39
7.4.60.0070.01416.60
7.4.50.0030.01216.39
7.4.40.0030.01516.70
7.4.30.0030.01416.63
7.4.00.0040.01414.77
7.3.330.0080.00013.13
7.3.320.0020.00213.13
7.3.310.0020.00516.38
7.3.300.0050.00316.17
7.3.290.0000.00716.27
7.3.280.0100.00816.29
7.3.270.0110.00617.40
7.3.260.0070.01016.27
7.3.250.0120.00816.32
7.3.240.0120.00416.24
7.3.230.0110.00716.58
7.3.210.0130.01016.45
7.3.200.0060.01316.45
7.3.190.0070.01016.38
7.3.180.0070.01016.47
7.3.170.0090.00816.30
7.3.160.0090.01316.57
7.3.10.0040.00916.64
7.3.00.0070.00716.58
7.2.330.0210.00016.59
7.2.320.0150.00916.27
7.2.310.0070.01416.52
7.2.300.0100.00716.67
7.2.290.0100.00716.49
7.2.130.0060.00816.90
7.2.120.0060.00516.57
7.2.110.0060.00616.75
7.2.100.0070.00716.63
7.2.90.0070.00516.91
7.2.80.0070.00716.59
7.2.70.0050.00916.87
7.2.60.0060.00716.81
7.2.50.0070.00516.60
7.2.40.0060.00616.68
7.2.30.0080.00616.75
7.2.20.0070.00916.74
7.2.10.0040.00916.77
7.2.00.0150.00317.44
7.1.250.0090.00315.61
7.1.240.0060.00915.46
7.1.230.0060.00615.68
7.1.220.0070.00715.54
7.1.210.0040.01115.37
7.1.200.0070.00615.57
7.1.190.0000.00915.42
7.1.180.0000.00915.41
7.1.170.0090.00315.50
7.1.160.0080.00415.45
7.1.150.0030.00715.74
7.1.140.0060.00615.71
7.1.130.0060.00615.44
7.1.120.0100.00315.53
7.1.110.0080.00815.40
7.1.100.0000.01315.87
7.1.90.0070.00715.45
7.1.80.0050.00515.53
7.1.70.0060.00516.38
7.1.60.0070.01317.27
7.1.50.0030.00716.12
7.1.40.0030.00815.71
7.1.30.0060.00615.43
7.1.20.0070.01015.52
7.1.10.0100.00715.49
7.1.00.0030.04418.85
7.0.330.0040.01115.27
7.0.320.0030.01015.14
7.0.310.0060.00915.34
7.0.300.0100.00315.35
7.0.290.0120.00015.34
7.0.280.0100.00315.20
7.0.270.0070.00715.25
7.0.260.0030.00615.02
7.0.250.0060.00315.21
7.0.240.0060.00315.35
7.0.230.0100.00615.50
7.0.220.0070.00715.30
7.0.210.0030.01015.32
7.0.200.0040.00615.77
7.0.190.0040.00815.40
7.0.180.0090.00315.37
7.0.170.0060.00614.98
7.0.160.0060.00315.16
7.0.150.0030.01215.32
7.0.140.0030.01015.23
7.0.130.0040.00815.29
7.0.120.0090.00315.32
7.0.110.0060.00915.16
7.0.100.0070.00715.29
7.0.90.0000.01415.36
7.0.80.0090.00615.09
7.0.70.0080.00315.32
7.0.60.0050.04017.53
7.0.50.0120.03816.65
7.0.40.0050.04416.91
7.0.30.0180.04216.82
7.0.20.0130.02616.81
7.0.10.0050.02316.72
7.0.00.0060.04816.71
5.6.380.0000.01314.10
5.6.370.0070.00414.44
5.6.360.0000.01514.46
5.6.350.0070.00714.46
5.6.340.0030.01014.07
5.6.330.0090.00314.29
5.6.320.0100.00314.68
5.6.310.0070.00714.30
5.6.300.0060.00314.00
5.6.290.0070.00314.13
5.6.280.0030.02117.69
5.6.270.0090.00014.25
5.6.260.0070.00714.33
5.6.250.0040.00414.12
5.6.240.0000.00814.23
5.6.230.0000.00914.04
5.6.220.0070.01014.24
5.6.210.0050.04417.39
5.6.200.0090.02616.17
5.6.190.0050.04417.48
5.6.180.0170.02917.34
5.6.170.0220.04217.22
5.6.160.0060.04317.42
5.6.150.0060.02316.03
5.6.140.0070.02516.16
5.6.130.0030.03316.09
5.6.120.0100.03317.63
5.6.110.0120.04217.49
5.6.100.0010.05117.60
5.6.90.0080.04017.36
5.6.80.0040.04817.17
5.6.70.0000.00814.14
5.6.60.0140.00014.30
5.6.50.0050.00813.99
5.6.40.0000.01713.81
5.6.30.0070.00313.76
5.6.20.0070.00714.23
5.6.10.0100.00714.04
5.6.00.0030.00914.29
5.5.380.0000.00910.96
5.5.370.0030.00611.02
5.5.360.0000.00811.19
5.5.350.0040.04615.58
5.5.340.0040.02014.50
5.5.330.0030.02615.54
5.5.320.0180.02615.64
5.5.310.0170.03915.54
5.5.300.0080.03714.60
5.5.290.0100.04214.39
5.5.280.0080.02515.68
5.5.270.0100.03715.84
5.5.260.0130.03815.89
5.5.250.0080.04315.65
5.5.240.0160.03515.50
5.5.230.0030.00911.01
5.5.220.0090.00310.89
5.5.210.0000.00810.72
5.5.200.0060.00610.79
5.5.190.0030.00710.98
5.5.180.0080.00410.71
5.5.170.0000.00511.12
5.5.160.0000.00510.74
5.5.150.0040.00410.82
5.5.140.0040.00410.86
5.5.130.0040.00411.13
5.5.120.0040.00510.80
5.5.110.0080.00410.41
5.5.100.0030.00610.86
5.5.90.0040.00711.05
5.5.80.0080.00410.87
5.5.70.0060.00011.01
5.5.60.0000.00910.97
5.5.50.0040.00410.60
5.5.40.0000.01210.53
5.5.30.0000.01110.81
5.5.20.0040.00810.79
5.5.10.0000.00710.75
5.5.00.0080.00311.00

preferences:
50.06 ms | 400 KiB | 5 Q