3v4l.org

run code in 300+ PHP versions simultaneously
<?php $salt = "fe5e5c41b"; $roll_id = 2; for($i = 0; $i < 1000; $i++) { echo generateRandomNumber(md5(uniqid(rand(), true)), $salt, 0) . "\r\n"; } function generateRandomNumber(string $seed, string $salt, int $roll): int { $roll_hash = hash("sha256", $seed . "-" . $salt . "-" . $roll); $roll_hash_first16 = substr($roll_hash, 0, 16); return abs(hexdec($roll_hash_first16) % 37); }

Abusive script

This script was stopped while abusing our resources

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)
8.3.100.0130.01718.84
8.3.90.0100.01718.66
8.3.80.0100.02018.38
8.3.70.0130.01318.59
8.3.60.0120.00918.52
8.3.50.0060.00618.68
8.3.40.0100.00319.41
8.3.30.0090.00319.38
8.3.20.0120.00019.34
8.3.10.0030.00919.38
8.3.00.0100.00319.51
8.2.220.0080.00416.69
8.2.210.0090.00318.18
8.2.200.0160.00918.16
8.2.190.0070.01518.42
8.2.180.0070.01418.54
8.2.170.0030.01019.49
8.2.160.0030.01019.61
8.2.150.0060.00619.48
8.2.140.0080.00419.36
8.2.130.0070.00719.36
8.2.120.0120.00319.48
8.2.110.0060.00619.48
8.2.100.0030.00919.36
8.2.90.0080.00419.50
8.2.80.0070.00719.36
8.2.70.0030.01019.35
8.2.60.0170.01019.13
8.2.50.0100.00319.02
7.3.60.0080.01114.98
7.3.50.0090.01314.88
7.3.40.0120.00915.03
7.3.30.0170.00714.86
7.3.20.0070.02016.70
7.3.10.0100.01016.82
7.3.00.0170.01716.63
7.2.190.0090.01415.14
7.2.180.0040.01814.82
7.2.170.0090.02114.99
7.2.160.0040.01515.04
7.2.150.0060.01316.96
7.2.140.0130.00316.91
7.2.130.0070.01416.85
7.2.120.0060.01717.14
7.2.110.0070.01617.03
7.2.100.0130.01616.84
7.2.90.0060.01217.02
7.2.80.0110.01416.94
7.2.70.0160.00016.99
7.2.60.0100.01317.16
7.2.50.0270.00317.00
7.2.40.0070.02117.02
7.2.30.0050.01916.95
7.2.20.0060.01917.06
7.2.10.0090.00916.73
7.2.00.0070.01316.82
7.1.300.0070.01515.68
7.1.290.0070.01015.95
7.1.280.0100.02215.81
7.1.270.0070.01315.80
7.1.260.0130.01615.95
7.1.250.0120.00915.89

preferences:
22.18 ms | 403 KiB | 5 Q