3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function gen_token() { $chars = array_merge(range("z","a"), range("Z", "A"), range("0", "9")); //Define the array length here so we dont have to call count() on each iteration $chars_len = count($chars)-1; $token_len = 25; $token = ""; for($i = 0; $i<$token_len; $i++) { $token .= $chars[mt_rand(0, $chars_len)]; } return $token;; } print strlen(gen_token()) == 25; ?>
based on hEgR4

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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.10.0090.00316.64
7.3.00.0110.00416.71
7.2.130.0080.01217.05
7.2.120.0090.00916.98
7.2.110.0030.00716.91
7.2.100.0090.00616.71
7.2.90.0030.01017.03
7.2.80.0090.00017.02
7.2.70.0130.00317.13
7.2.60.0060.00617.12
7.2.50.0000.00917.10
7.2.40.0040.00817.09
7.2.30.0080.00617.09
7.2.20.0030.00716.84
7.2.10.0040.01117.05
7.2.00.0090.00218.09
7.1.250.0030.01415.85
7.1.100.0590.00312.09
7.1.70.0070.00716.96
7.1.60.0100.01019.59
7.1.50.0300.01416.92
7.1.00.0030.07722.45
7.0.200.0000.00916.71
7.0.60.0070.03720.00
7.0.50.0030.08317.87
7.0.40.0170.07720.20
7.0.30.0270.05720.23
7.0.20.0130.05020.07
7.0.10.0230.05020.08
7.0.00.0030.05020.22
5.6.280.0030.05020.89
5.6.210.0130.08020.55
5.6.200.0100.03318.16
5.6.190.0130.06720.51
5.6.180.4230.04020.77
5.6.170.0270.08020.54
5.6.160.0070.07020.44
5.6.150.0100.07318.34
5.6.140.0100.08018.18
5.6.130.0100.08318.18
5.6.120.0200.07720.97
5.6.110.0130.08021.14
5.6.100.0100.03720.98
5.6.90.0000.05020.97
5.6.80.0070.07720.39
5.5.350.0030.06020.38
5.5.340.0130.06317.96
5.5.330.0130.03320.59
5.5.320.0500.07020.34
5.5.310.0230.09020.34
5.5.300.0000.04317.99
5.5.290.0000.07017.96
5.5.280.0130.08020.90
5.5.270.0170.08020.76
5.5.260.0070.08720.64
5.5.250.0100.07320.58
5.5.240.0230.06320.35
5.4.450.0700.06319.59
5.4.440.0470.06019.30
5.4.430.0570.06019.50
5.4.420.0730.04319.62
5.4.410.0670.05319.34
5.4.400.0600.05719.16
5.4.390.0670.05018.87
5.4.380.0700.04719.05
5.4.370.0600.06018.91
5.4.360.0830.06018.97
5.4.350.0730.04319.19
5.4.340.0600.05719.12
5.4.320.0630.05719.14
5.4.310.0670.05319.16
5.4.300.0700.04719.18
5.4.290.0700.04719.09
5.4.280.0530.06318.97
5.4.270.0630.05318.86
5.4.260.0670.05019.16
5.4.250.0700.04719.15
5.4.240.0700.05719.09
5.4.230.0700.04719.23
5.4.220.0630.05318.86
5.4.210.0630.05319.05
5.4.200.0730.04716.63
5.4.190.0530.04719.11
5.4.180.0670.06019.05
5.4.170.0600.06318.97
5.4.160.0730.05018.93
5.4.150.0730.05319.10
5.4.140.0670.04716.27
5.4.130.0630.05016.25
5.4.120.0570.05716.57
5.4.110.0730.04016.30
5.4.100.0770.03716.25
5.4.90.0630.05016.60
5.4.80.0630.05016.38
5.4.70.0630.05016.25
5.4.60.0600.05016.53
5.4.50.0630.04716.50
5.4.40.0500.05316.49
5.4.30.0670.04316.29
5.4.20.0630.04716.21
5.4.10.0700.04016.36
5.4.00.0670.04315.91
5.3.290.0700.05314.77
5.3.280.0570.06014.45
5.3.270.0570.05714.70
5.3.260.0630.05714.59
5.3.250.0370.04714.61
5.3.240.0070.05314.52
5.3.230.0130.04714.46
5.3.220.0070.05314.46
5.3.210.0700.05014.65
5.3.200.0600.05314.62
5.3.190.0600.05314.45
5.3.180.0530.05714.57
5.3.170.0630.04714.51
5.3.160.0600.05314.52
5.3.150.0600.05314.51
5.3.140.0630.05014.45
5.3.130.0600.06014.50
5.3.120.0570.04714.52
5.3.110.0670.04714.65
5.3.100.0570.05714.04
5.3.90.0630.05013.87
5.3.80.0630.05013.95
5.3.70.0600.05314.11
5.3.60.0600.05013.97
5.3.50.0630.04714.05
5.3.40.0570.05713.89
5.3.30.0600.05013.82
5.3.20.0530.05713.66
5.3.10.0630.04713.53
5.3.00.0600.05013.59
5.2.170.0430.04711.24
5.2.160.0500.04011.11
5.2.150.0500.04311.20
5.2.140.0500.04311.00
5.2.130.0600.03311.08
5.2.120.0470.04311.21
5.2.110.0400.05011.06
5.2.100.0470.04011.20
5.2.90.0470.04010.96
5.2.80.0470.04311.04
5.2.70.0330.04711.00
5.2.60.0530.03711.08
5.2.50.0500.04011.11
5.2.40.0270.04710.85
5.2.30.0370.03710.89
5.2.20.0400.04010.84
5.2.10.0330.04010.91
5.2.00.0500.03010.78
5.1.60.0500.0409.91
5.1.50.0400.0339.89
5.1.40.0370.0379.92
5.1.30.0400.03310.39
5.1.20.0470.02310.32
5.1.10.0400.0339.94
5.1.00.0430.0309.95
5.0.50.0270.0238.37
5.0.40.0200.0278.35
5.0.30.0270.0408.33
5.0.20.0170.0278.05
5.0.10.0230.0378.28
5.0.00.0200.0408.21
4.4.90.0130.0235.88
4.4.80.0130.0235.76
4.4.70.0230.0135.80
4.4.60.0170.0205.79
4.4.50.0130.0235.78
4.4.40.0200.0335.89
4.4.30.0230.0175.89
4.4.20.0170.0205.85
4.4.10.0170.0205.93
4.4.00.0130.0375.99
4.3.110.0130.0235.85
4.3.100.0170.0205.73
4.3.90.0170.0205.69
4.3.80.0230.0275.84
4.3.70.0170.0305.76
4.3.60.0200.0235.69
4.3.50.0170.0205.80
4.3.40.0200.0305.66
4.3.30.0100.0234.55
4.3.20.0070.0234.42
4.3.10.0030.0274.37
4.3.00.0170.0177.22