3v4l.org

run code in 300+ PHP versions simultaneously
<?php function columns($uarr) { $n=$uarr; if (count($n) == 0) return array(); else if (count($n) == 1) return array_chunk($n[0], 1); array_unshift($uarr, NULL); $transpose = call_user_func_array('array_map', $uarr); return array_map('array_filter', $transpose); } function bead_sort($uarr) { foreach ($uarr as $e) $poles []= array_fill(0, $e, 1); return array_map('count', columns(columns($poles))); } echo 'Original Array : '.' '; print_r(array(5,3,1,3,8,7,4,1,1,3)); echo ' '.'After Bead sort : '.' '; print_r(bead_sort(array(5,3,1,3,8,7,4,1,1,3)));

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.0060.01216.63
8.3.50.0140.00621.14
8.3.40.0110.01118.84
8.3.30.0110.00418.91
8.3.20.0080.00020.16
8.3.10.0040.00423.48
8.3.00.0040.00419.38
8.2.180.0120.00616.32
8.2.170.0090.00622.96
8.2.160.0070.01120.39
8.2.150.0060.00324.18
8.2.140.0000.00724.66
8.2.130.0140.00426.16
8.2.120.0080.00022.11
8.2.110.0040.00422.16
8.2.100.0080.00417.91
8.2.90.0000.00819.21
8.2.80.0040.00418.04
8.2.70.0040.00417.63
8.2.60.0050.00318.04
8.2.50.0040.00718.07
8.2.40.0040.00419.77
8.2.30.0060.00319.90
8.2.20.0040.00417.68
8.2.10.0030.00618.12
8.2.00.0070.00317.80
8.1.280.0060.00925.92
8.1.270.0080.00023.98
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0090.00024.01
8.1.230.0070.00419.16
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00717.47
8.1.190.0000.00817.51
8.1.180.0090.00318.10
8.1.170.0060.00320.25
8.1.160.0080.00022.01
8.1.150.0060.00318.59
8.1.140.0000.00817.38
8.1.130.0030.00317.89
8.1.120.0030.00517.47
8.1.110.0000.00717.46
8.1.100.0040.00417.37
8.1.90.0080.00017.46
8.1.80.0000.00817.46
8.1.70.0070.00017.38
8.1.60.0040.00417.63
8.1.50.0040.00417.48
8.1.40.0030.00517.44
8.1.30.0040.00417.66
8.1.20.0050.00317.61
8.1.10.0040.00417.40
8.1.00.0030.00617.41
8.0.300.0040.00418.80
8.0.290.0040.00417.16
8.0.280.0000.00718.45
8.0.270.0000.00817.25
8.0.260.0060.00017.25
8.0.250.0040.00416.86
8.0.240.0000.00716.80
8.0.230.0030.00316.84
8.0.220.0000.00816.91
8.0.210.0000.00816.76
8.0.200.0060.00017.00
8.0.190.0030.00616.84
8.0.180.0000.01116.99
8.0.170.0040.00416.94
8.0.160.0000.00716.94
8.0.150.0030.00516.88
8.0.140.0090.00316.78
8.0.130.0000.00613.36
8.0.120.0040.00416.83
8.0.110.0050.00216.88
8.0.100.0070.00016.68
8.0.90.0070.00016.79
8.0.80.0150.00016.88
8.0.70.0070.00016.80
8.0.60.0030.00616.77
8.0.50.0040.00416.96
8.0.30.0140.00617.21
8.0.20.0090.01217.40
8.0.10.0040.00417.04
8.0.00.0090.01016.73
7.4.330.0060.00015.00
7.4.320.0030.00316.51
7.4.300.0060.00016.58
7.4.290.0030.00316.57
7.4.280.0000.01016.51
7.4.270.0000.00816.60
7.4.260.0030.00316.54
7.4.250.0000.00816.46
7.4.240.0020.00616.61
7.4.230.0030.00316.70
7.4.220.0030.01416.46
7.4.210.0100.00516.54
7.4.200.0030.00316.55
7.4.190.0030.00316.48
7.4.160.0120.00616.49
7.4.150.0090.00817.40
7.4.140.0100.00717.86
7.4.130.0090.00816.51
7.4.120.0080.00916.53
7.4.110.0060.01616.34
7.4.100.0200.00616.25
7.4.90.0110.00616.50
7.4.80.0140.00419.39
7.4.70.0180.00016.40
7.4.60.0090.00616.41
7.4.50.0000.00716.38
7.4.40.0060.01022.77
7.4.30.0080.00816.58
7.4.00.0060.01015.19
7.3.330.0000.00613.20
7.3.320.0020.00213.23
7.3.310.0000.00716.32
7.3.300.0000.00716.34
7.3.290.0000.01416.29
7.3.280.0050.01216.39
7.3.270.0110.00617.40
7.3.260.0090.01516.43
7.3.250.0140.00616.53
7.3.240.0160.00016.60
7.3.230.0130.00316.50
7.3.210.0160.00016.58
7.3.200.0070.01319.39
7.3.190.0090.01016.27
7.3.180.0040.01116.41
7.3.170.0160.00016.30
7.3.160.0070.01016.34
7.3.120.0060.00914.87
7.2.330.0160.00316.80
7.2.320.0000.01716.68
7.2.310.0190.00316.55
7.2.300.0130.00316.81
7.2.290.0120.00616.84
7.2.60.0030.01316.94
7.2.00.0100.00719.68
7.1.200.0040.00815.84
7.1.100.0040.01118.02
7.1.70.0040.00417.02
7.1.60.0070.01819.46
7.1.50.0280.00634.82
7.1.00.0100.07022.51
7.0.200.0040.00416.89
7.0.140.0070.07022.00
7.0.60.0030.08021.89
7.0.50.0070.08017.86
7.0.40.0130.08720.12
7.0.30.0170.04320.23
7.0.20.0230.06720.15
7.0.10.0100.05320.07
7.0.00.0070.05320.33
5.6.280.0030.07321.11
5.6.210.0030.08720.72
5.6.200.0070.05718.19
5.6.190.0070.08720.33
5.6.180.0070.07020.52
5.6.170.0200.05320.47
5.6.160.0130.04020.54
5.6.150.0130.06018.15
5.6.140.0100.07718.15
5.6.130.0130.07318.24
5.6.120.0070.03720.99
5.6.110.0130.08021.10
5.6.100.0200.07721.14
5.6.90.0070.08321.02
5.6.80.0200.06720.36
5.5.350.0330.07020.34
5.5.340.0030.09017.94
5.5.330.0030.04020.34
5.5.320.0330.06720.37
5.5.310.0130.04320.32
5.5.300.0070.05718.03
5.5.290.0030.04318.08
5.5.280.0030.04320.78
5.5.270.0100.04720.98
5.5.260.0000.05020.75
5.5.250.0030.07320.69
5.5.240.0030.08020.19
5.4.450.0770.06319.63
5.4.440.0870.04319.57
5.4.430.0400.06319.61
5.4.420.0700.05719.57
5.4.410.0830.04719.50
5.4.400.0830.05019.13
5.4.390.0130.06318.86
5.4.380.0500.06018.60
5.4.370.0300.06018.83
5.4.360.0270.05718.50
5.4.350.0330.06018.81
5.4.340.0430.05318.63
5.4.320.0050.03712.54
5.4.310.0090.03712.53
5.4.300.0050.03712.53
5.4.290.0070.04612.52
5.4.280.0070.04112.41
5.4.270.0090.04412.41
5.4.260.0140.07312.41
5.4.250.0170.08512.41
5.4.240.0110.04412.41
5.4.230.0110.04412.40
5.4.220.0160.09012.40
5.4.210.0210.10012.41
5.4.200.0100.06112.41
5.4.190.0150.05612.40
5.4.180.0140.08212.40
5.4.170.0100.08112.41
5.4.160.0090.05212.40
5.4.150.0070.06212.40
5.4.140.0150.05412.09
5.4.130.0100.03812.07
5.4.120.0090.07212.03
5.4.110.0060.05312.03
5.4.100.0100.05112.03
5.4.90.0080.04612.02
5.4.80.0120.06212.02
5.4.70.0100.06212.02
5.4.60.0100.05812.02
5.4.50.0270.12512.02
5.4.40.0110.07012.01
5.4.30.0120.05112.01
5.4.20.0210.07712.00
5.4.10.0150.08012.00
5.4.00.0090.04911.50
5.3.290.0050.04012.80
5.3.280.0120.05112.71
5.3.270.0130.06412.72
5.3.260.0090.05812.71
5.3.250.0110.08412.72
5.3.240.0260.08612.72
5.3.230.0090.08312.71
5.3.220.0280.10312.68
5.3.210.0130.05412.68
5.3.200.0100.06712.68
5.3.190.0160.06412.68
5.3.180.0120.06312.67
5.3.170.0120.05512.68
5.3.160.0160.05312.68
5.3.150.0090.05812.68
5.3.140.0090.05712.67
5.3.130.0080.05712.67
5.3.120.0100.08212.66
5.3.110.0040.06112.66
5.3.100.0090.05012.14
5.3.90.0080.05012.13
5.3.80.0120.05412.12
5.3.70.0080.05212.12
5.3.60.0110.04912.10
5.3.50.0100.05112.05
5.3.40.0060.05012.05
5.3.30.0070.03712.01
5.3.20.0070.04111.79
5.3.10.0080.03611.75
5.3.00.0070.03811.74
5.2.170.0070.0419.25
5.2.160.0070.0409.25
5.2.150.0100.0559.25
5.2.140.0070.0449.25
5.2.130.0070.0419.21
5.2.120.0060.0429.21
5.2.110.0080.0539.21
5.2.100.0130.0589.21
5.2.90.0070.0419.21
5.2.80.0100.0419.20
5.2.70.0100.0429.20
5.2.60.0050.0539.16
5.2.50.0170.0449.13
5.2.40.0220.0669.11
5.2.30.0130.0469.08
5.2.20.0170.0669.07
5.2.10.0200.0888.98
5.2.00.0230.0788.84
5.1.60.0100.0728.13
5.1.50.0400.0968.12
5.1.40.0080.0658.11
5.1.30.0170.0568.45
5.1.20.0100.0388.48
5.1.10.0150.0608.20
5.1.00.0120.0618.20
5.0.50.0230.0716.68
5.0.40.0180.0696.54
5.0.30.0040.0346.35
5.0.20.0040.0276.32
5.0.10.0120.0266.29
5.0.00.0120.0446.29
4.4.90.0080.0394.78
4.4.80.0070.0154.75
4.4.70.0100.0314.76
4.4.60.0050.0334.75
4.4.50.0150.0554.77
4.4.40.0070.0424.71
4.4.30.0050.0304.75
4.4.20.0050.0294.84
4.4.10.0080.0354.85
4.4.00.0050.0404.76
4.3.110.0050.0224.67
4.3.100.0060.0214.66
4.3.90.0040.0214.63
4.3.80.0040.0294.58
4.3.70.0030.0234.63
4.3.60.0040.0214.63
4.3.50.0060.0454.63
4.3.40.0090.0434.54
4.3.30.0000.0273.34
4.3.20.0050.0313.32
4.3.10.0040.0193.27
4.3.00.0070.02010.54

preferences:
38 ms | 401 KiB | 5 Q