3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tracking { function __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)
7.1.70.0102.49147.19
7.1.60.0172.48547.56
7.1.50.0102.49247.16
7.1.00.0132.48752.24
7.0.200.0402.46046.95
7.0.140.0072.49351.98
7.0.100.0372.46351.41
7.0.90.0502.45051.39
7.0.80.0672.43351.56
7.0.70.2302.27051.30
7.0.60.1572.34351.42
7.0.50.2672.23351.79
7.0.40.1902.31047.98
7.0.30.1302.37047.98
7.0.20.0272.47347.96
7.0.10.0402.46047.91
7.0.00.0502.43047.86
5.6.280.0072.49327.61
5.6.250.0072.49329.27
5.6.240.0072.49329.18
5.6.230.0202.48029.28
5.6.220.0032.47729.21
5.6.210.0102.49028.27
5.6.200.0202.46329.26
5.6.190.0102.49029.37
5.6.180.0132.48729.34
5.6.170.0032.49730.17
5.6.160.0102.49029.77
5.6.150.0202.48029.27
5.6.140.0102.48029.34
5.6.130.0072.49329.50
5.6.120.0072.32328.41
5.6.110.0102.46729.27
5.6.100.0102.30728.43
5.6.90.0132.45729.44
5.6.80.0032.45027.83
5.6.70.0132.45029.11
5.6.60.0102.48028.91
5.6.50.0032.46029.27
5.6.40.0072.45328.71
5.6.30.0132.46728.75
5.6.20.0102.45328.70
5.6.10.0102.47027.86
5.6.00.0102.39728.35
5.5.380.0172.48327.73
5.5.370.0072.49328.17
5.5.360.0072.49328.37
5.5.350.0172.48328.09
5.5.340.0102.49028.83
5.5.330.0072.49328.82
5.5.320.0172.48327.63
5.5.310.0032.49728.64
5.5.300.0132.48729.06
5.5.290.0132.47728.83
5.5.280.0072.47029.31
5.5.270.0102.48028.78
5.5.260.0072.47028.48
5.5.250.0032.47727.36
5.5.240.0102.45727.83
5.5.230.0002.41728.42
5.5.220.0172.46328.08
5.5.210.0132.45327.61
5.5.200.0072.49327.16
5.5.190.0072.45027.04
5.5.180.0172.47727.98
5.5.160.0072.38727.07
5.5.150.0132.44026.84
5.5.140.0002.48028.05
5.5.130.0102.45028.33
5.5.120.0032.47727.86
5.5.110.0032.47027.39
5.5.100.0172.43727.45
5.5.90.0102.44027.21
5.5.80.0172.46327.85
5.5.70.0072.45727.55
5.5.60.0102.46327.57
5.5.50.0102.46027.75
5.5.40.0172.47328.37
5.5.30.0072.46028.76
5.5.20.0132.48027.87
5.5.10.0072.49327.91
5.5.00.0032.47728.05
5.4.450.0072.49327.80
5.4.440.1202.38027.16
5.4.430.0072.49327.51
5.4.420.0132.48728.41
5.4.410.0172.48327.43
5.4.400.0102.49027.29
5.4.390.0102.49027.74
5.4.380.0072.49327.20
5.4.370.0132.48727.11
5.4.360.0072.43026.98
5.4.350.0102.49027.10
5.4.340.0172.48327.37
5.4.320.0132.48726.97
5.4.310.0132.39326.95
5.4.300.0032.49728.23
5.4.290.0032.49727.13
5.4.280.0102.49028.16
5.4.270.0172.48327.19
5.4.260.0172.48327.49
5.4.250.0102.49027.02
5.4.240.0072.49327.55
5.4.230.0032.46727.18
5.4.220.0072.49327.14
5.4.210.0032.49727.45
5.4.200.2402.26026.83
5.4.190.0132.48727.71
5.4.180.0102.49027.24
5.4.170.0072.49327.09
5.4.160.0072.49327.20
5.4.150.0032.49727.29
5.4.140.0132.44024.33
5.4.130.0072.49324.34
5.4.120.0102.49024.79
5.4.110.0172.48324.04
5.4.100.0132.48724.56
5.4.90.0072.49324.81
5.4.80.0072.49324.49
5.4.70.0102.49024.53
5.4.60.0002.50025.12
5.4.50.0172.48324.59
5.4.40.0072.49324.61
5.4.30.0072.49324.84
5.4.20.0132.48724.58
5.4.10.0102.49024.79
5.4.00.0032.49723.77
5.3.290.0102.47321.21
5.3.280.0132.48721.78
5.3.270.0132.48721.06
5.3.260.0172.48321.04
5.3.250.0032.49722.12
5.3.240.0102.49021.97
5.3.230.0072.49321.71
5.3.220.0072.49321.50
5.3.210.0102.49020.76
5.3.200.0132.48721.44
5.3.190.0102.48021.86
5.3.180.2972.20320.57
5.3.170.0102.49022.29
5.3.160.1632.33321.08
5.3.150.0102.49021.60
5.3.140.0002.50020.99
5.3.130.0072.49321.50
5.3.120.0032.49720.71
5.3.110.2072.29321.37
5.3.100.0102.49021.00
5.3.90.0102.49021.03
5.3.80.0102.49021.27
5.3.70.0032.49720.91
5.3.60.0172.44320.55
5.3.50.0002.50021.08
5.3.40.0202.48019.96
5.3.30.0032.49721.01
5.3.20.0072.49320.70
5.3.10.0072.49320.79
5.3.00.0072.49320.64
5.2.170.0032.49716.82
5.2.160.0032.49717.59
5.2.150.0132.48717.46
5.2.140.0132.48717.56
5.2.130.0032.49717.70
5.2.120.0072.49317.52
5.2.110.0032.49716.79
5.2.100.0102.49017.29
5.2.90.0002.50017.09
5.2.80.0072.49317.11
5.2.70.0002.50017.06
5.2.60.0172.48317.64
5.2.50.0032.49716.86
5.2.40.0102.49017.18
5.2.30.0132.48716.87
5.2.20.0072.49317.44
5.2.10.0072.49317.24
5.2.00.0002.50017.72
5.1.60.0102.49016.53
5.1.50.0102.49016.49
5.1.40.0172.48316.25
5.1.30.0232.47716.55
5.1.20.0072.49316.52
5.1.10.0072.49316.24
5.1.00.0032.49715.94
5.0.50.0102.49012.36
5.0.40.0072.49312.48
5.0.30.0032.49711.92
5.0.20.0172.47311.88
5.0.10.0102.44012.05
5.0.00.0072.45312.33
4.4.90.0072.4639.85
4.4.80.0072.4939.90
4.4.70.0072.49310.13
4.4.60.0072.49310.00
4.4.50.0032.49710.07
4.4.40.0102.4909.44
4.4.30.0002.5009.85
4.4.20.0032.4979.82
4.4.10.0002.5009.89
4.4.00.0132.4879.43
4.3.110.0002.5009.63
4.3.100.0002.5009.66
4.3.90.0032.48310.20
4.3.80.0032.4779.71
4.3.70.1802.3179.59
4.3.60.0032.4909.65
4.3.50.0032.4079.87
4.3.40.0072.4639.37
4.3.30.0072.4938.74
4.3.20.0002.4706.89
4.3.10.0002.2436.89
4.3.00.0002.4836.89

preferences:
34.48 ms | 401 KiB | 5 Q