3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRandomTo($num){ $arr = array(); do { $arr[] = rand(1, $num - array_sum($arr)); } while (array_sum($arr) < $num); return $arr; } print_r(getRandomTo(12));

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)
7.4.00.0140.00314.84
7.3.120.0090.00614.73
7.3.110.0070.00714.93
7.3.100.0090.00614.79
7.3.90.0060.00314.95
7.3.80.0030.01414.86
7.3.70.0040.00714.73
7.3.60.0090.00614.68
7.3.50.0030.00814.86
7.3.40.0180.00014.93
7.3.30.0040.00814.90
7.3.20.0040.00716.57
7.3.10.0100.00716.73
7.3.00.0060.00616.81
7.2.250.0120.00615.16
7.2.240.0110.00715.08
7.2.230.0070.01015.10
7.2.220.0030.00915.15
7.2.210.0000.01115.04
7.2.200.0060.00914.91
7.2.190.0070.01015.04
7.2.180.0100.00315.04
7.2.170.0090.00614.75
7.2.00.0040.00719.32
7.1.330.0030.01316.02
7.1.320.0030.01315.96
7.1.310.0070.00415.84
7.1.300.0080.00815.92
7.1.290.0090.00315.89
7.1.280.0000.01615.52
7.1.270.0030.00715.63
7.1.260.0050.00515.94
7.1.70.0030.00517.13
7.1.60.0100.01319.43
7.1.50.0060.01516.65
7.1.00.0030.07722.31
7.0.200.0070.00016.86
7.0.140.0000.08022.07
7.0.100.0200.03719.89
7.0.90.0170.07319.93
7.0.80.0130.07319.89
7.0.70.0130.07319.90
7.0.60.0170.05319.93
7.0.50.0070.08720.27
7.0.40.0070.06020.12
7.0.30.0030.09020.09
7.0.20.0100.04720.18
7.0.10.0100.05720.04
7.0.00.0100.08320.13
5.6.280.0000.07321.15
5.6.250.0070.08720.57
5.6.240.0030.07320.69
5.6.230.0030.05720.70
5.6.220.0130.07720.62
5.6.210.0030.08720.49
5.6.200.0070.08021.18
5.6.190.0070.06321.04
5.6.180.0130.07020.96
5.6.170.0100.06720.95
5.6.160.0070.09021.09
5.6.150.0030.09021.05
5.6.140.0130.06721.04
5.6.130.0130.07021.02
5.6.120.0100.08021.02
5.6.110.0130.07021.02
5.6.100.0100.08721.16
5.6.90.0070.07721.00
5.6.80.0070.07020.40
5.6.70.0130.07720.43
5.6.60.0130.07320.40
5.6.50.0100.08320.44
5.6.40.0000.08320.53
5.6.30.0070.08720.41
5.6.20.0130.05020.37
5.6.10.0070.07720.38
5.6.00.0100.06720.39
5.5.380.0100.07020.43
5.5.370.0130.07720.44
5.5.360.0100.08320.50
5.5.350.0100.07020.34
5.5.340.0100.08320.93
5.5.330.0130.08020.73
5.5.320.0130.06720.92
5.5.310.0130.08020.77
5.5.300.0070.06720.85
5.5.290.0070.04020.76
5.5.280.0130.07320.79
5.5.270.0130.08020.77
5.5.260.0100.08020.90
5.5.250.0000.05320.70
5.5.240.0100.06720.03
5.5.230.0070.07020.28
5.5.220.0100.05320.20
5.5.210.0030.07720.11
5.5.200.0130.05720.26
5.5.190.0070.05320.27
5.5.180.0030.08020.22
5.5.160.0130.07320.13
5.5.150.0030.08720.18
5.5.140.0100.07320.21
5.5.130.0070.03720.20
5.5.120.0100.07020.13
5.5.110.0030.08020.15
5.5.100.0070.08020.07
5.5.90.0030.05020.04
5.5.80.0100.08020.09
5.5.70.0030.08020.06
5.5.60.0030.07320.05
5.5.50.0070.07720.16
5.5.40.0030.07720.09
5.5.30.0030.08320.05
5.5.20.0070.04320.08
5.5.10.0030.04720.02
5.5.00.0070.06719.97
5.4.450.0130.05719.54
5.4.440.0070.05319.37
5.4.430.0000.06019.27
5.4.420.0130.07319.55
5.4.410.0070.08019.32
5.4.400.0000.08319.04
5.4.390.0070.06018.95
5.4.380.0100.07318.90
5.4.370.0200.06719.03
5.4.360.0100.07319.12
5.4.350.0130.07019.14
5.4.340.0100.06719.21
5.4.320.0170.07019.20
5.4.310.0030.07719.10
5.4.300.0100.07319.18
5.4.290.0030.05319.18
5.4.280.0030.08019.16
5.4.270.0130.03718.88
5.4.260.0130.07019.15
5.4.250.0070.08019.13
5.4.240.0070.07319.22
5.4.230.0100.07018.90
5.4.220.0100.07018.89
5.4.210.0070.06719.04
5.4.200.0100.06719.04
5.4.190.0070.07019.22
5.4.180.0100.07318.89
5.4.170.0030.03718.84
5.4.160.0030.05018.88
5.4.150.0070.03719.01
5.4.140.0070.08016.32
5.4.130.0000.05016.32
5.4.120.0100.07316.41
5.4.110.0070.06316.35
5.4.100.0070.06716.27
5.4.90.0130.06016.43
5.4.80.0100.06716.41
5.4.70.0030.04716.32
5.4.60.0100.07016.40
5.4.50.0100.05316.48
5.4.40.0070.05016.46
5.4.30.0030.04316.31
5.4.20.0030.04316.30
5.4.10.0130.06716.40
5.4.00.0070.06015.89
5.3.290.0070.07714.67
5.3.280.0070.07014.61
5.3.270.0000.04714.63
5.3.260.0070.04314.67
5.3.250.0070.07714.66
5.3.240.0070.07714.59
5.3.230.0000.05014.70
5.3.220.0030.07014.57
5.3.210.0030.05014.69
5.3.200.0030.07314.66
5.3.190.0130.06014.53
5.3.180.0170.06014.61
5.3.170.0070.07714.61
5.3.160.0100.07314.49
5.3.150.0000.04014.51
5.3.140.0070.08014.55
5.3.130.0100.07714.65
5.3.120.0030.08014.59
5.3.110.0030.08014.51
5.3.100.0070.05014.09
5.3.90.0030.04014.08
5.3.80.0030.05014.14
5.3.70.0070.03313.96
5.3.60.0070.03313.89
5.3.50.0070.03313.84
5.3.40.0030.04713.93
5.3.30.0070.03013.96
5.3.20.0000.04013.67
5.3.10.0000.03713.63
5.3.00.0030.03713.77
5.2.170.0030.02711.16
5.2.160.0000.03011.04
5.2.150.0000.03311.22
5.2.140.0000.03011.23
5.2.130.0070.02311.00
5.2.120.0000.03011.13
5.2.110.0000.02711.09
5.2.100.0000.03011.17
5.2.90.0030.02711.12
5.2.80.0030.05711.15
5.2.70.0030.03011.21
5.2.60.0000.03010.98
5.2.50.0030.02711.14
5.2.40.0000.04711.06
5.2.30.0070.02310.92
5.2.20.0000.04711.05
5.2.10.0070.02010.81
5.2.00.0070.02310.82
5.1.60.0030.0439.83
5.1.50.0000.0279.88
5.1.40.0000.0279.83
5.1.30.0030.02310.36
5.1.20.0070.03710.45
5.1.10.0100.02710.16
5.1.00.0000.02710.15
5.0.50.0030.0178.61
5.0.40.0030.0178.51
5.0.30.0000.0308.29
5.0.20.0030.0208.28
5.0.10.0070.0138.28
5.0.00.0000.0308.28
4.4.90.0000.0208.28
4.4.80.0000.0138.28
4.4.70.0000.0408.28
4.4.60.0000.0208.28
4.4.50.0030.0138.28
4.4.40.0000.0238.28
4.4.30.0030.0278.28
4.4.20.0000.0178.28
4.4.10.0000.0178.28
4.4.00.0030.0278.28
4.3.110.0000.0238.28
4.3.100.0030.0138.28
4.3.90.0000.0178.28
4.3.80.0070.0408.28
4.3.70.0000.0178.28
4.3.60.0000.0208.28
4.3.50.0030.0208.28
4.3.40.0030.0208.28
4.3.30.0000.0178.28
4.3.20.0030.0138.28
4.3.10.0000.0238.28
4.3.00.0000.0138.28

preferences:
38.09 ms | 400 KiB | 5 Q