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, 1); var_dump($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.4.10.0130.00614.97
7.4.00.0060.01214.81
7.3.130.0070.01014.66
7.3.120.0100.00715.21
7.3.110.0140.00414.65
7.3.100.0090.00314.92
7.3.90.0000.01514.71
7.3.80.0000.00914.58
7.3.70.0030.01114.90
7.3.60.0030.00615.00
7.3.50.0000.01215.02
7.3.40.0040.00814.86
7.3.30.0070.00715.02
7.3.20.0130.00316.84
7.3.10.0060.00916.83
7.3.00.0090.00016.77
7.2.260.0070.01115.07
7.2.250.0070.01015.25
7.2.240.0070.01014.95
7.2.230.0070.01014.79
7.2.220.0100.00714.96
7.2.210.0030.00915.00
7.2.200.0070.00715.05
7.2.190.0080.00414.96
7.2.180.0070.00315.08
7.2.170.0040.01114.97
7.2.160.0040.01214.74
7.2.150.0070.00417.03
7.2.140.0100.01017.01
7.2.130.0030.01016.95
7.2.120.0090.00916.89
7.2.110.0100.00317.02
7.2.100.0100.00316.89
7.2.90.0100.00316.79
7.2.80.0120.00317.04
7.2.70.0040.01517.05
7.2.60.0040.01216.91
7.2.50.0040.01117.01
7.2.40.0080.00516.89
7.2.30.0000.01517.02
7.2.20.0040.01116.96
7.2.10.0000.01417.02
7.2.00.0070.00918.32
7.1.330.0110.00015.86
7.1.320.0060.00315.71
7.1.310.0100.00315.88
7.1.300.0000.01415.86
7.1.290.0030.00616.11
7.1.280.0100.00715.52
7.1.270.0000.01515.86
7.1.260.0090.00915.75
7.1.250.0080.00815.53
7.1.240.0060.00615.54
7.1.230.0000.01615.75
7.1.220.0000.01315.94
7.1.210.0000.01515.52
7.1.200.0090.00615.97
7.1.190.0070.01115.86
7.1.180.0170.00015.73
7.1.170.0000.00915.58
7.1.160.0000.00815.63
7.1.150.0000.01715.60
7.1.140.0030.01015.87
7.1.130.0070.00315.61
7.1.120.0040.01115.94
7.1.110.0060.00615.98
7.1.100.0140.00015.84
7.1.90.0060.00615.76
7.1.80.0030.01015.74
7.1.70.0020.00916.62
7.1.60.0080.01117.68
7.1.50.0110.00616.32
7.1.40.0030.00615.54
7.1.30.0030.00615.77
7.1.20.0060.00315.79
7.1.10.0100.00715.71
7.1.00.0070.03919.25
7.0.330.0060.00315.47
7.0.320.0040.01115.41
7.0.310.0030.00615.54
7.0.300.0030.01015.44
7.0.290.0120.00315.15
7.0.280.0000.01315.41
7.0.270.0000.01015.43
7.0.260.0090.00015.46
7.0.250.0060.00315.25
7.0.240.0070.00715.67
7.0.230.0090.00315.41
7.0.220.0000.01315.57
7.0.210.0130.00015.44
7.0.200.0190.00715.14
7.0.190.0120.00315.68
7.0.180.0110.00315.58
7.0.170.0070.00415.43
7.0.160.0000.01415.42
7.0.150.0080.00615.50
7.0.140.0030.04218.96
7.0.130.0000.01315.20
7.0.120.0030.03118.96
7.0.110.0030.01015.59
7.0.100.0040.01115.46
7.0.90.0000.01115.50
7.0.80.0100.00315.58
7.0.70.0110.00315.39
7.0.60.0100.04117.82
7.0.50.0070.04416.79
7.0.40.0170.03515.65
7.0.30.0080.04415.74
7.0.20.0050.04315.66
7.0.10.0080.03515.75
7.0.00.0050.04015.59
5.6.400.0090.00014.24
5.6.390.0030.01014.40
5.6.380.0060.00614.59
5.6.370.0030.01014.16
5.6.360.0080.00314.40
5.6.350.0090.00614.27
5.6.340.0030.00614.30
5.6.330.0030.00614.27
5.6.320.0000.01114.18
5.6.310.0030.01014.43
5.6.300.0030.00614.54
5.6.290.0030.00614.02
5.6.280.0020.04217.83
5.6.270.0030.00714.10
5.6.260.0000.01414.26
5.6.250.0030.01414.40
5.6.240.0080.00414.27
5.6.230.0000.01714.46
5.6.220.0040.01114.20
5.6.210.0020.02517.51
5.6.200.0040.04116.26
5.6.190.0080.04216.17
5.6.180.0030.02716.24
5.6.170.0050.02716.45
5.6.160.0080.02816.18
5.6.150.0010.03416.35
5.6.140.0050.03316.15
5.6.130.0070.03416.42
5.6.120.0030.04416.46
5.6.110.0050.04516.25
5.6.100.0070.03016.19
5.6.90.0080.03016.28
5.6.80.0070.04215.92
5.6.70.0030.03316.01
5.6.60.0050.04716.02
5.6.50.0080.03815.99
5.6.40.0080.03815.92
5.6.30.0080.03915.83
5.6.20.0060.04315.89
5.6.10.0100.04015.87
5.6.00.0020.04415.93
5.5.380.0030.00514.13
5.5.370.0060.00614.20
5.5.360.0030.00614.48
5.5.350.0220.03817.39
5.5.340.0020.03516.21
5.5.330.0020.04516.21
5.5.320.0020.02916.17
5.5.310.0100.02016.12
5.5.300.0030.02716.09
5.5.290.0040.04616.23
5.5.280.0030.04616.01
5.5.270.0080.04316.27
5.5.260.0070.02716.20
5.5.250.0030.04315.97
5.5.240.0100.01815.73
5.5.230.0020.04415.77
5.5.220.0090.04115.80
5.5.210.0020.03515.98
5.5.200.0060.04115.95
5.5.190.0070.03615.74
5.5.180.0070.04215.76
5.5.170.0030.00614.07
5.5.160.0070.04315.92
5.5.150.0050.03815.75
5.5.140.0090.04115.77
5.5.130.0100.04015.82
5.5.120.0080.02515.79
5.5.110.0030.02515.61
5.5.100.0070.04015.87
5.5.90.0070.03315.68
5.5.80.0030.04515.92
5.5.70.0050.03915.52
5.5.60.0080.04015.65
5.5.50.0050.04315.86
5.5.40.0030.04415.80
5.5.30.0050.04415.78
5.5.20.0090.04015.81
5.5.10.0050.04515.87
5.5.00.0050.02915.45
5.4.450.0110.03615.10
5.4.440.0000.03415.28
5.4.430.0090.02315.23
5.4.420.0140.03715.12
5.4.410.0050.04615.22
5.4.400.0040.03415.07
5.4.390.0080.03315.03
5.4.380.0070.02015.11
5.4.370.0030.02914.89
5.4.360.0070.04014.97
5.4.350.0060.03315.14
5.4.340.0030.04115.11
5.4.330.0030.00711.11
5.4.320.0110.03515.08
5.4.310.0060.03014.94
5.4.300.0080.03615.17
5.4.290.0070.04015.11
5.4.280.0080.03814.99
5.4.270.0000.03215.17
5.4.260.0070.02415.04
5.4.250.0060.04315.14
5.4.240.0080.03515.22
5.4.230.0070.04015.08
5.4.220.0070.03315.19
5.4.210.0020.02615.19
5.4.200.0090.02615.05
5.4.190.0080.04115.03
5.4.180.0070.04015.07
5.4.170.0040.02714.82
5.4.160.0060.03915.01
5.4.150.0050.03514.95
5.4.140.0070.01713.84
5.4.130.0020.02413.71
5.4.120.0040.04413.63
5.4.110.0070.01813.79
5.4.100.0080.01813.79
5.4.90.0050.03513.80
5.4.80.0050.02813.68
5.4.70.0050.03113.88
5.4.60.0050.02913.80
5.4.50.0050.02313.74
5.4.40.0020.03013.81
5.4.30.0080.03313.68
5.4.20.0060.01613.71
5.4.10.0050.01813.77
5.4.00.0070.03113.43
5.3.290.0050.04012.74
5.3.280.0050.03912.64
5.3.270.0060.03312.61
5.3.260.0070.04012.57
5.3.250.0050.03812.67
5.3.240.0040.03912.63
5.3.230.0100.03812.49
5.3.220.0080.03212.54
5.3.210.0030.03212.60
5.3.200.0050.02312.56
5.3.190.0100.03212.62
5.3.180.0020.04412.71
5.3.170.0080.03812.54
5.3.160.0050.04012.60
5.3.150.0070.03212.46
5.3.140.0090.03712.64
5.3.130.0050.03312.56
5.3.120.0030.04512.68
5.3.110.0050.02112.60
5.3.100.0120.02712.41
5.3.90.0050.03912.42
5.3.80.0060.02012.41
5.3.70.0020.04612.31
5.3.60.0020.02712.44
5.3.50.0040.02412.36
5.3.40.0050.02512.21
5.3.30.0030.04312.41
5.3.20.0000.03012.33
5.3.10.0040.02012.03
5.3.00.0050.02811.98
5.2.170.0070.06011.11
5.2.160.0130.05311.14
5.2.150.0030.06711.33
5.2.140.0030.04011.32
5.2.130.0070.05311.20
5.2.120.0000.03011.18
5.2.110.0070.05311.33
5.2.100.0000.04311.30
5.2.90.0030.03011.27
5.2.80.0030.03011.06
5.2.70.0100.05311.28
5.2.60.0030.03311.02
5.2.50.0100.04311.18
5.2.40.0070.05711.16
5.2.30.0030.03010.93
5.2.20.0030.03311.03
5.2.10.0030.03011.02
5.2.00.0000.06310.77
5.1.60.0000.03010.04
5.1.50.0030.02310.22
5.1.40.0030.05310.16
5.1.30.0070.04310.66
5.1.20.0000.04710.38
5.1.10.0000.03010.11
5.1.00.0070.02010.11
5.0.50.0000.0408.60
5.0.40.0000.0238.50
5.0.30.0000.0338.41
5.0.20.0030.0308.23
5.0.10.0000.0378.32
5.0.00.0000.0608.32
4.4.90.0000.0237.86
4.4.80.0000.0377.86
4.4.70.0000.0207.86
4.4.60.0000.0177.86
4.4.50.0000.0177.86
4.4.40.0000.0277.86
4.4.30.0000.0377.86
4.4.20.0030.0307.86
4.4.10.0000.0377.86
4.4.00.0000.0337.86
4.3.110.0000.0277.86
4.3.100.0000.0307.86
4.3.90.0000.0207.86
4.3.80.0000.0477.86
4.3.70.0030.0337.86
4.3.60.0000.0207.86
4.3.50.0030.0277.86
4.3.40.0070.0437.86
4.3.30.0070.0277.86
4.3.20.0000.0277.86
4.3.10.0100.0277.86
4.3.00.0000.0377.86

preferences:
38.16 ms | 401 KiB | 5 Q