3v4l.org

run code in 300+ PHP versions simultaneously
<?php function weightedRand($min, $max, $gamma) { $offset = $max - $min + 1; return floor($min + pow(lcg_value(), $gamma) * $offset); } $ola = weightedRand(1, 5, 5); print_r($ola);

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.2.00.0080.00019.32
7.1.70.0030.00617.43
7.1.60.0000.01317.08
7.1.50.0210.01434.75
7.1.00.0000.09022.56
7.0.200.0030.01316.76
7.0.140.0030.07322.07
7.0.60.0100.07320.10
7.0.50.0170.06318.16
7.0.40.0230.05320.23
7.0.30.0230.07320.36
7.0.20.0330.07720.28
7.0.10.0330.08020.29
7.0.00.0070.06020.19
5.6.280.0030.07321.18
5.6.210.0170.05720.61
5.6.200.0170.07718.38
5.6.190.0000.05020.68
5.6.180.3830.04020.52
5.6.170.0270.04020.76
5.6.160.0070.08720.63
5.6.150.0070.04018.28
5.6.140.0130.07018.41
5.6.130.0100.07718.50
5.6.120.0030.04021.21
5.6.110.0030.08721.20
5.6.100.0200.07321.15
5.6.90.0170.07721.18
5.6.80.0070.04020.63
5.6.70.4400.03320.50
5.5.350.0030.08020.63
5.5.340.0000.04318.08
5.5.330.0030.07320.52
5.5.320.0030.05020.50
5.5.310.0070.04720.39
5.5.300.0000.06318.22
5.5.290.0000.09718.13
5.5.280.0170.08020.96
5.5.270.0030.05320.90
5.5.260.0100.08720.92
5.5.250.0130.06720.98
5.5.240.0000.04320.25
5.4.450.0530.06319.60
5.4.440.0500.06319.43
5.4.430.0070.06019.71
5.4.420.0030.06319.45
5.4.410.0170.05019.63
5.4.400.0770.00018.92
5.4.390.0970.00018.98
5.4.380.0270.05318.91
5.4.370.0270.05318.93
5.4.360.0230.05318.71
5.4.350.0300.05718.93
5.4.340.0230.05018.75
5.4.320.0070.03612.55
5.4.310.0070.04112.54
5.4.300.0070.03412.56
5.4.290.0090.04212.55
5.4.280.0050.03612.44
5.4.270.0100.05318.83
5.4.260.0170.05019.02
5.4.250.0130.05018.83
5.4.240.0070.05318.86
5.4.230.0100.05019.01
5.4.220.0100.06319.04
5.4.210.0130.05718.73
5.4.200.0130.06719.04
5.4.190.0130.06718.84
5.4.180.0070.05718.83
5.4.170.0030.06018.93
5.4.160.0030.05719.02
5.4.150.0070.06019.01
5.4.140.0100.06716.63
5.4.130.0130.06016.66
5.4.120.0100.05716.65
5.4.110.0130.07316.55
5.4.100.0030.06016.58
5.4.90.0100.05316.58
5.4.80.0100.05016.51
5.4.70.0130.06716.57
5.4.60.0270.05016.55
5.4.50.0130.06316.73
5.4.40.0130.05016.40
5.4.30.0030.06316.41
5.4.20.0130.06316.53
5.4.10.0130.06016.48
5.4.00.0100.05716.06
5.3.290.0070.03912.80
5.3.280.0170.05714.61
5.3.270.0070.08014.86
5.3.260.0170.04714.85
5.3.250.0030.05314.85
5.3.240.0130.06714.86
5.3.230.0030.06314.78
5.3.220.0100.06314.82
5.3.210.0200.04314.84
5.3.200.0070.05714.79
5.3.190.0100.05314.84
5.3.180.0100.05014.57
5.3.170.0030.06314.83
5.3.160.0100.06314.70
5.3.150.0230.05314.75
5.3.140.0100.07014.94
5.3.130.0170.06714.93
5.3.120.0170.07014.70
5.3.110.0070.08014.70
5.3.100.0100.06314.29
5.3.90.0030.05014.17
5.3.80.0100.05014.28
5.3.70.0100.04714.14
5.3.60.0070.07014.27
5.3.50.0070.06013.98
5.3.40.0100.05313.96
5.3.30.0130.04014.04
5.3.20.0070.04713.80
5.3.10.0070.05013.77
5.3.00.0200.04313.75
5.2.170.0130.03311.42
5.2.160.0070.04311.30
5.2.150.0130.05011.41
5.2.140.0000.05011.40
5.2.130.0100.04011.35
5.2.120.0030.05711.18
5.2.110.0070.04311.36
5.2.100.0030.06011.23
5.2.90.0030.04311.18
5.2.80.0070.03711.26
5.2.70.0100.06311.21
5.2.60.0130.03311.18
5.2.50.0100.04311.28
5.2.40.0100.03311.08
5.2.30.0030.04311.22
5.2.20.0130.04311.13
5.2.10.0100.04010.87
5.2.00.0000.06011.00
5.1.60.0070.03010.02
5.1.50.0070.03310.25
5.1.40.0130.04710.27
5.1.30.0170.04310.66
5.1.20.0070.03310.36
5.1.10.0030.03710.25
5.1.00.0000.04710.14
5.0.50.0030.0278.84
5.0.40.0030.0408.54
5.0.30.0030.0408.39
5.0.20.0100.0278.32
5.0.10.0030.0378.37
5.0.00.0070.0438.30
4.4.90.0070.0277.61
4.4.80.0070.0177.61
4.4.70.0070.0277.61
4.4.60.0100.0177.61
4.4.50.0030.0307.61
4.4.40.0000.0337.61
4.4.30.0030.0207.61
4.4.20.0130.0137.61
4.4.10.0030.0207.61
4.4.00.0000.0407.61
4.3.110.0030.0277.61
4.3.100.0070.0177.61
4.3.90.0070.0237.61
4.3.80.0000.0337.61
4.3.70.0030.0207.61
4.3.60.0000.0207.61
4.3.50.0030.0307.61
4.3.40.0000.0437.61
4.3.30.0030.0207.61
4.3.20.0070.0207.61
4.3.10.0030.0307.61
4.3.00.0100.0208.20

preferences:
40.2 ms | 400 KiB | 5 Q