3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tracking { public __construct($client) { } function generateID($length) { $id = $client; $x = 0; while ($x < $length) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789'; $id .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); } return $id; } } $parcel = new Tracking(1426); echo $parcel->generateID(20);

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)
5.4.250.0100.05018.76
5.4.240.0070.05018.91
5.4.230.0100.04718.96
5.4.220.0000.06018.94
5.4.210.0130.04318.91
5.4.200.0070.05018.92
5.4.190.0230.03318.92
5.4.180.0000.06018.94
5.4.170.0030.05718.80
5.4.160.0100.06318.73
5.4.150.0070.05318.72
5.4.140.0070.05016.43
5.4.130.0130.04316.36
5.4.120.0070.05316.52
5.4.110.0130.06316.45
5.4.100.0130.04316.54
5.4.90.0230.06016.36
5.4.80.0100.04316.46
5.4.70.0030.05316.39
5.4.60.0100.04716.27
5.4.50.0170.05716.48
5.4.40.0100.04316.65
5.4.30.0100.04316.56
5.4.20.0030.05016.56
5.4.10.0130.04716.43
5.4.00.0130.06316.03
5.3.280.0000.05714.68
5.3.270.0130.04714.58
5.3.260.0100.05314.69
5.3.250.0130.06314.62
5.3.240.0030.05714.82
5.3.230.0070.07014.75
5.3.220.0030.05314.73
5.3.210.0070.08314.72
5.3.200.0100.04714.73
5.3.190.0130.04714.63
5.3.180.0170.04014.63
5.3.170.0070.06714.64
5.3.160.0200.05714.73
5.3.150.0100.05014.54
5.3.140.0070.05014.57
5.3.130.0030.05714.45
5.3.120.0030.06014.72
5.3.110.0070.05014.53
5.3.100.0070.05014.12
5.3.90.0100.04714.09
5.3.80.0030.05314.00
5.3.70.0070.05314.23
5.3.60.0070.05314.09
5.3.50.0070.04713.97
5.3.40.0030.05313.93
5.3.30.0170.04014.13
5.3.20.0100.04313.75
5.3.10.0070.06313.73
5.3.00.0130.04313.71

preferences:
138.64 ms | 1394 KiB | 7 Q