3v4l.org

run code in 300+ PHP versions simultaneously
<?php $priorities = array( 6=> 10, 5=> 40, 4=> 35, 3=> 5, 2=> 5 ); # you put each of the values N times, based on N being the probability # each occurrence of the number in the array is a change it will get picked up # same is with lotteries $numbers = array(); foreach($priorities as $k=>$v){ for($i=0; $i<$v; $i++) $numbers[] = $k; } # then you just pick a random value from the array # the more occurrences, the more chances, and the occurrences are based on "priority" $entry = $numbers[array_rand($numbers)]; echo "x: ".$entry;

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.3.10.0070.00416.61
7.3.00.0090.00316.68
7.2.130.0000.01116.78
7.2.120.0070.00716.91
7.2.110.0100.00316.79
7.2.100.0030.01016.97
7.2.90.0060.00916.81
7.2.80.0060.00616.64
7.2.70.0060.00916.84
7.2.60.0060.00617.21
7.2.50.0000.00916.70
7.2.40.0030.01017.09
7.2.30.0090.00616.95
7.2.20.0040.00817.00
7.2.10.0100.00317.03
7.2.00.0030.00917.87
7.1.250.0060.00615.56
7.1.70.0060.00317.09
7.1.60.0070.01719.17
7.1.50.0000.01516.93
7.1.00.0030.08322.35
7.0.200.0040.00416.72
7.0.140.0030.07321.92
7.0.100.0170.03719.96
7.0.90.0070.06720.04
7.0.80.0100.06319.88
7.0.70.0230.04319.86
7.0.60.0130.06320.01
7.0.50.0200.06720.30
7.0.40.0070.08020.00
7.0.30.0170.07720.10
7.0.20.0070.08020.00
7.0.10.0130.07320.09
7.0.00.0070.04720.07
5.6.280.0030.07320.88
5.6.250.0070.08020.67
5.6.240.0070.08720.51
5.6.230.0100.08320.58
5.6.220.0130.07720.49
5.6.210.0100.08720.55
5.6.200.0070.04321.10
5.6.190.0030.04721.08
5.6.180.0070.07321.03
5.6.170.0030.07321.13
5.6.160.0070.08321.01
5.6.150.0070.08321.01
5.6.140.0030.07720.94
5.6.130.0130.06721.02
5.6.120.0070.07721.09
5.6.110.0130.07021.12
5.6.100.0070.08321.11
5.6.90.0130.08320.93
5.6.80.0070.04020.44
5.6.70.0070.08320.40
5.6.60.0100.07320.41
5.6.50.0130.06720.55
5.6.40.0000.04320.54
5.6.30.0070.06020.49
5.6.20.0070.07320.45
5.6.10.0030.08320.36
5.6.00.0030.08320.36
5.5.380.0100.07020.41
5.5.370.0130.04020.34
5.5.360.0100.07320.34
5.5.350.0100.07020.41
5.5.340.0230.06720.91
5.5.330.0000.04720.87
5.5.320.0100.07020.75
5.5.310.0130.07720.79
5.5.300.0270.06320.89
5.5.290.0070.07720.86
5.5.280.0070.09320.87
5.5.270.0070.07020.76
5.5.260.0070.08320.85
5.5.250.0100.07720.67
5.5.240.0070.03720.03
5.5.230.0100.07720.28
5.5.220.0100.03320.23
5.5.210.0100.07720.24
5.5.200.0070.06720.18
5.5.190.0100.07320.12
5.5.180.0130.07720.14
5.5.160.0070.06720.18
5.5.150.0100.06020.13
5.5.140.0100.08020.12
5.5.130.0130.06720.23
5.5.120.0100.08020.10
5.5.110.0130.04020.17
5.5.100.0000.04320.07
5.5.90.0100.07720.05
5.5.80.0100.04020.04
5.5.70.0170.07019.96
5.5.60.0130.05319.93
5.5.50.0070.07720.09
5.5.40.0100.04019.95
5.5.30.0070.04720.13
5.5.20.0030.07720.07
5.5.10.0070.07020.03
5.5.00.0070.07720.02
5.4.450.0100.07719.39
5.4.440.0100.07319.47
5.4.430.0000.04719.32
5.4.420.0100.09019.41
5.4.410.0100.07319.22
5.4.400.0030.04019.12
5.4.390.0200.06719.11
5.4.380.0070.03319.12
5.4.370.0100.05019.04
5.4.360.0070.03319.11
5.4.350.0070.06718.98
5.4.340.0100.04318.90
5.4.320.0030.09018.96
5.4.310.0030.08019.02
5.4.300.0070.07019.05
5.4.290.0130.06719.11
5.4.280.0070.03719.05
5.4.270.0070.07018.96
5.4.260.0070.05018.95
5.4.250.0000.06018.77
5.4.240.0030.08719.04
5.4.230.0030.06019.05
5.4.220.0100.07318.75
5.4.210.0070.04319.15
5.4.200.0100.06719.16
5.4.190.0030.05019.04
5.4.180.0070.07319.05
5.4.170.0170.07019.07
5.4.160.0070.04718.88
5.4.150.0100.07318.96
5.4.140.0100.07316.07
5.4.130.0030.04016.23
5.4.120.0100.04716.33
5.4.110.0100.04016.26
5.4.100.0030.04316.27
5.4.90.0170.06016.21
5.4.80.0030.07716.40
5.4.70.0170.05716.20
5.4.60.0070.04016.42
5.4.50.0070.06316.30
5.4.40.0000.04316.47
5.4.30.0030.06316.41
5.4.20.0070.03316.40
5.4.10.0130.03316.39
5.4.00.0130.05315.72
5.3.290.0000.08314.61
5.3.280.0170.04314.59
5.3.270.0100.07314.61
5.3.260.0100.06014.47
5.3.250.0030.07014.56
5.3.240.0030.08314.52
5.3.230.0030.07314.60
5.3.220.0000.04714.52
5.3.210.0100.05314.58
5.3.200.0030.07714.58
5.3.190.0070.06014.54
5.3.180.0070.04714.54
5.3.170.0070.05314.39
5.3.160.0070.08714.41
5.3.150.0130.07314.40
5.3.140.0070.07714.57
5.3.130.0130.06714.41
5.3.120.0100.07714.56
5.3.110.0030.06014.39
5.3.100.0000.04714.02
5.3.90.0000.07313.84
5.3.80.0070.07713.88
5.3.70.0100.03314.00
5.3.60.0100.06713.98
5.3.50.0070.03013.96
5.3.40.0030.03313.96
5.3.30.0100.06013.88
5.3.20.0070.03313.64
5.3.10.0030.07013.66
5.3.00.0030.07013.60
5.2.170.0100.05312.23
5.2.160.0000.03012.23
5.2.150.0030.04712.23
5.2.140.0070.02712.23
5.2.130.0000.03012.23
5.2.120.0030.05012.23
5.2.110.0030.06712.23
5.2.100.0030.06312.23
5.2.90.0070.03712.23
5.2.80.0030.05312.23
5.2.70.0030.03712.23
5.2.60.0030.05312.23
5.2.50.0000.05312.23
5.2.40.0030.02712.23
5.2.30.0100.05712.23
5.2.20.0030.05712.23
5.2.10.0030.05012.23
5.2.00.0030.06012.23
5.1.60.0070.05012.23
5.1.50.0100.04312.23
5.1.40.0030.04712.23
5.1.30.0070.04712.23
5.1.20.0030.05712.23
5.1.10.0000.05312.23
5.1.00.0070.05312.23
5.0.50.0030.03712.23
5.0.40.0130.03712.23
5.0.30.0030.06012.23
5.0.20.0100.03712.23
5.0.10.0030.03712.23
5.0.00.0100.05712.23
4.4.90.0070.02712.23
4.4.80.0030.03712.23
4.4.70.0000.02012.23
4.4.60.0070.03012.23
4.4.50.0030.03012.23
4.4.40.0100.04712.23
4.4.30.0000.03012.23
4.4.20.0030.02312.23
4.4.10.0070.01312.23
4.4.00.0030.03312.23
4.3.110.0030.03312.23
4.3.100.0070.03012.23
4.3.90.0030.03712.23
4.3.80.0030.05312.23
4.3.70.0000.03712.23
4.3.60.0030.02312.23
4.3.50.0030.03312.23
4.3.40.0000.03012.23
4.3.30.0000.02712.23
4.3.20.0000.03712.23
4.3.10.0000.02712.23
4.3.00.0030.03312.23

preferences:
37.68 ms | 401 KiB | 5 Q