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, 4, 2.2); 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.0040.00819.11
7.1.70.0040.00417.05
7.1.60.0090.01619.31
7.1.50.0070.01717.11
7.1.00.0000.08022.63
7.0.200.0000.00716.92
7.0.140.0030.07322.29
7.0.120.0130.06722.23
7.0.60.0170.07320.12
7.0.50.0070.08318.21
7.0.40.0100.07717.85
7.0.30.0130.06717.97
7.0.20.0170.07017.97
7.0.10.0000.07017.94
7.0.00.0030.07317.89
5.6.280.0000.07321.31
5.6.210.0030.07720.66
5.6.200.0030.07018.30
5.6.190.0100.05718.30
5.6.180.0170.05718.40
5.6.170.0070.07718.38
5.6.160.0100.07318.46
5.6.150.0130.07718.42
5.6.140.0030.04718.31
5.6.130.0070.08018.41
5.6.120.0000.08718.27
5.6.110.0070.08318.30
5.6.100.0030.05318.36
5.6.90.0030.06318.31
5.6.80.0130.07317.75
5.6.70.0100.07317.75
5.6.60.0030.08317.67
5.6.50.0130.03017.73
5.6.40.0100.07317.63
5.6.30.0170.05317.71
5.6.20.0170.06717.82
5.6.10.0100.03717.63
5.6.00.0070.03717.63
5.5.350.0000.08720.56
5.5.340.0000.05018.11
5.5.330.0030.08318.11
5.5.320.0030.08318.13
5.5.310.0070.06318.13
5.5.300.0100.07718.19
5.5.290.0000.04318.13
5.5.280.0070.08718.14
5.5.270.0070.08018.10
5.5.260.0100.07018.27
5.5.250.0100.07317.91
5.5.240.0070.06017.48
5.5.230.0170.07317.59
5.5.220.0000.04717.48
5.5.210.0130.07017.46
5.5.200.0100.07017.49
5.5.190.0070.07717.52
5.5.180.0030.08017.46
5.5.160.0100.06017.52
5.5.150.0130.05717.48
5.5.140.0130.07717.46
5.5.130.0070.07017.55
5.5.120.0030.04717.43
5.5.110.0070.05017.42
5.5.100.0070.04717.36
5.5.90.0100.07017.35
5.5.80.0030.03717.38
5.5.70.0170.05017.34
5.5.60.0130.03017.32
5.5.50.0070.06317.51
5.5.40.0100.05317.32
5.5.30.0030.07017.40
5.5.20.0030.04717.35
5.5.10.0100.07317.37
5.5.00.0070.08017.41
5.4.450.0070.07019.47
5.4.440.0170.05019.50
5.4.430.0130.07719.49
5.4.420.0030.04319.54
5.4.410.0070.04019.34
5.4.400.0070.08319.08
5.4.390.0100.07019.24
5.4.380.0070.08019.18
5.4.370.0030.04319.15
5.4.360.0070.07719.22
5.4.350.0100.07319.46
5.4.340.0100.03719.25
5.4.320.0070.04019.14
5.4.310.0000.08319.36
5.4.300.0030.08019.22
5.4.290.0030.08019.22
5.4.280.0130.06719.07
5.4.270.0070.03719.24
5.4.260.0000.05319.14
5.4.250.0000.04319.21
5.4.240.0130.06719.13
5.4.230.0030.07019.24
5.4.220.0070.04019.17
5.4.210.0130.05719.21
5.4.200.0200.04319.19
5.4.190.0100.07319.31
5.4.180.0130.06719.45
5.4.170.0100.07719.23
5.4.160.0130.05719.23
5.4.150.0130.06019.22
5.4.140.0030.06016.68
5.4.130.0070.03716.71
5.4.120.0030.08016.41
5.4.110.0100.03316.54
5.4.100.0030.07016.64
5.4.90.0130.07016.63
5.4.80.0070.07316.64
5.4.70.0170.03316.61
5.4.60.0130.06316.68
5.4.50.0070.07016.59
5.4.40.0130.05316.60
5.4.30.0070.04016.38
5.4.20.0030.05016.57
5.4.10.0100.04016.79
5.4.00.0100.05715.86
5.3.290.0000.04314.89
5.3.280.0100.07314.73
5.3.270.0070.03714.78
5.3.260.0130.07314.70
5.3.250.0130.06314.83
5.3.240.0070.04714.76
5.3.230.0100.07714.86
5.3.220.0030.07714.81
5.3.210.0130.05014.82
5.3.200.0100.06714.82
5.3.190.0030.05714.68
5.3.180.0030.08014.79
5.3.170.0130.07014.80
5.3.160.0030.04314.78
5.3.150.0070.04014.79
5.3.140.0030.07014.81
5.3.130.0030.05714.69
5.3.120.0170.06714.68
5.3.110.0070.07714.67
5.3.100.0070.04314.21
5.3.90.0030.04314.27
5.3.80.0030.05014.14
5.3.70.0030.07714.14
5.3.60.0030.05314.03
5.3.50.0030.07714.16
5.3.40.0100.07014.09
5.3.30.0030.06714.09
5.3.20.0070.06313.84
5.3.10.0000.04014.04
5.3.00.0030.06713.85
5.2.170.0070.04311.37
5.2.160.0070.03011.38
5.2.150.0070.06011.55
5.2.140.0070.05311.26
5.2.130.0070.05711.14
5.2.120.0130.03711.50
5.2.110.0000.04011.34
5.2.100.0100.03011.24
5.2.90.0100.05711.27
5.2.80.0000.03311.31
5.2.70.0070.06311.22
5.2.60.0030.06311.29
5.2.50.0030.04311.10
5.2.40.0070.04011.02
5.2.30.0070.03311.37
5.2.20.0100.05710.99
5.2.10.0030.06010.95
5.2.00.0070.06010.88
5.1.60.0070.04310.26
5.1.50.0000.05310.23
5.1.40.0070.05310.25
5.1.30.0030.05710.55
5.1.20.0000.06310.61
5.1.10.0100.04310.29
5.1.00.0030.04010.09
5.0.50.0000.0338.56
5.0.40.0030.0438.62
5.0.30.0130.0438.50
5.0.20.0030.0478.42
5.0.10.0000.0338.56
5.0.00.0000.0708.19
4.4.90.0000.0377.96
4.4.80.0000.0407.96
4.4.70.0030.0337.96
4.4.60.0000.0377.96
4.4.50.0030.0307.96
4.4.40.0100.0477.96
4.4.30.0030.0377.96
4.4.20.0030.0277.96
4.4.10.0070.0337.96
4.4.00.0100.0207.96
4.3.110.0000.0277.96
4.3.100.0000.0177.96
4.3.90.0000.0377.96
4.3.80.0030.0437.96
4.3.70.0030.0177.96
4.3.60.0000.0177.96
4.3.50.0130.0037.96
4.3.40.0000.0237.96
4.3.30.0000.0237.96
4.3.20.0070.0307.96
4.3.10.0000.0407.96
4.3.00.0000.0337.96

preferences:
37.43 ms | 401 KiB | 5 Q