3v4l.org

run code in 300+ PHP versions simultaneously
<?php function randomString($length=10,$symbols=false) { $grabbag = "abcdefghijklmnopqrstuvwxyz0123456789"; if ($symbols) { $grabbag .= '!@#$%^&*()_+{}-=[]|\\:";\'<,>.?/~`'; } $string = ''; $len = strlen($grabbag)-1; while ($length--) { $char = $grabbag[rand(0,$len)]; if (rand(0,1)) { $char = strtoupper($char); } $string .= $char; } return $string; } echo randomString(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.4.10.0080.01115.05
7.4.00.0040.01314.95
7.3.130.0100.00814.86
7.3.120.0050.01114.87
7.3.110.0080.00914.73
7.3.100.0060.00914.74
7.3.90.0070.00714.85
7.3.80.0060.00814.92
7.3.70.0060.00814.73
7.3.60.0050.00714.74
7.3.50.0030.01014.91
7.3.40.0020.01314.72
7.3.30.0050.00914.72
7.3.20.0070.00716.69
7.3.10.0040.00916.71
7.3.00.0090.00516.66
7.2.260.0070.01114.94
7.2.250.0080.00915.09
7.2.240.0070.00915.11
7.2.230.0050.01015.07
7.2.220.0040.00915.03
7.2.210.0080.00615.06
7.2.200.0030.01115.05
7.2.190.0060.00915.09
7.2.180.0070.00814.99
7.2.170.0080.00615.07
7.2.160.0080.00615.02
7.2.150.0030.01116.87
7.2.140.0070.00917.06
7.2.130.0090.00616.86
7.2.120.0050.01216.97
7.2.110.0060.00916.93
7.2.100.0050.00916.99
7.2.90.0080.00917.01
7.2.80.0070.00916.97
7.2.70.0040.01116.97
7.2.60.0040.01117.14
7.2.50.0060.00916.92
7.2.40.0070.00716.98
7.2.30.0060.00916.89
7.2.20.0050.00817.03
7.2.10.0090.00616.97
7.2.00.0080.00717.54
7.1.330.0050.00915.78
7.1.320.0060.00815.79
7.1.310.0050.00715.73
7.1.300.0080.00615.84
7.1.290.0060.00915.85
7.1.280.0090.00615.68
7.1.270.0060.00815.65
7.1.260.0060.00915.91
7.1.250.0030.01215.84
7.1.240.0090.00715.95
7.1.230.0050.00815.91
7.1.220.0050.01015.85
7.1.210.0040.01115.84
7.1.200.0030.01115.79
7.1.190.0060.00515.82
7.1.180.0050.01015.79
7.1.170.0090.00515.84
7.1.160.0050.00915.83
7.1.150.0040.01115.88
7.1.140.0070.00315.95
7.1.130.0030.00815.81
7.1.120.0050.00515.59
7.1.110.0000.01315.81
7.1.100.0030.01115.85
7.1.90.0090.00215.79
7.1.80.0020.01215.71
7.1.70.0010.01016.16
7.1.60.0080.00816.96
7.1.50.0080.00716.21
7.1.40.0080.00515.70
7.1.30.0050.01015.80
7.1.20.0050.01015.74
7.1.10.0080.00315.66
7.1.00.0060.02817.92
7.0.330.0040.01015.33
7.0.320.0070.00515.39
7.0.310.0050.01015.24
7.0.300.0020.01115.53
7.0.290.0080.00315.41
7.0.280.0080.00515.35
7.0.270.0050.00615.45
7.0.260.0030.00815.40
7.0.250.0070.00815.55
7.0.240.0070.00615.41
7.0.230.0030.01015.39
7.0.220.0060.00415.45
7.0.210.0100.00515.54
7.0.200.0060.00515.95
7.0.190.0060.00815.42
7.0.180.0070.00715.46
7.0.170.0050.00815.46
7.0.160.0030.00915.51
7.0.150.0070.00515.35
7.0.140.0090.02617.59
7.0.130.0040.00915.46
7.0.120.0050.01417.63
7.0.110.0060.00815.41
7.0.100.0050.00915.38
7.0.90.0040.00615.40
7.0.80.0030.00815.27
7.0.70.0030.01215.35
7.0.60.0100.03016.91
7.0.50.0050.02116.43
7.0.40.0030.03615.65
7.0.30.0200.03215.69
7.0.20.0120.01615.78
7.0.10.0010.03115.65
7.0.00.0080.03015.64
5.6.400.0100.00614.52
5.6.390.0040.01114.40
5.6.380.0100.00414.38
5.6.370.0030.00814.46
5.6.360.0070.00714.47
5.6.350.0070.00614.59
5.6.340.0100.00514.38
5.6.330.0050.01014.44
5.6.320.0030.00814.55
5.6.310.0050.01014.38
5.6.300.0020.00914.55
5.6.290.0050.00814.44
5.6.280.0090.02616.67
5.6.270.0040.00814.44
5.6.260.0070.00514.48
5.6.250.0110.00314.20
5.6.240.0030.01014.29
5.6.230.0050.00814.38
5.6.220.0040.01114.35
5.6.210.0030.02016.39
5.6.200.0060.03115.64
5.6.190.0070.03216.53
5.6.180.0130.02816.39
5.6.170.0200.02516.54
5.6.160.0010.02116.42
5.6.150.0060.02715.67
5.6.140.0030.02115.64
5.6.130.0050.01915.55
5.6.120.0050.02416.67
5.6.110.0060.01716.63
5.6.100.0100.02716.52
5.6.90.0050.03216.59
5.6.80.0060.03116.37
5.6.70.0040.00914.54
5.6.60.0020.01014.21
5.6.50.0080.00514.47
5.6.40.0100.00314.32
5.6.30.0030.01214.34
5.6.20.0080.00614.14
5.6.10.0060.00814.05
5.6.00.0070.00914.31
5.5.380.0020.01014.34
5.5.370.0070.00514.39
5.5.360.0040.00714.24
5.5.350.0090.03416.33
5.5.340.0060.01715.44
5.5.330.0040.03016.23
5.5.320.0150.03016.38
5.5.310.0150.02816.39
5.5.300.0050.03215.50
5.5.290.0050.02515.54
5.5.280.0080.02216.43
5.5.270.0060.03216.70
5.5.260.0080.02616.48
5.5.250.0050.03116.40
5.5.240.0120.02416.29
5.5.230.0030.00914.39
5.5.220.0060.00714.42
5.5.210.0060.00814.41
5.5.200.0030.00714.16
5.5.190.0030.01214.27
5.5.180.0120.00214.27
5.5.170.0100.00414.21
5.5.160.0030.01314.23
5.5.150.0020.01314.23
5.5.140.0040.01214.37
5.5.130.0070.00514.06
5.5.120.0060.00714.50
5.5.110.0070.00514.29
5.5.100.0060.00814.24
5.5.90.0050.00914.13
5.5.80.0030.00814.49
5.5.70.0040.00714.41
5.5.60.0030.01214.31
5.5.50.0060.00514.37
5.5.40.0060.00714.39
5.5.30.0030.01114.31
5.5.20.0050.01114.12
5.5.10.0030.01014.40
5.5.00.0070.00514.23
5.4.450.0190.02014.77
5.4.440.0220.01814.75
5.4.430.0160.01714.32
5.4.420.0130.02014.37
5.4.410.0130.01714.28
5.4.400.0280.01414.15
5.4.390.0100.02014.21
5.4.380.0150.01914.17
5.4.370.0160.02114.04
5.4.360.0140.01814.13
5.4.350.0280.01614.14
5.4.340.0160.01814.10
5.4.330.0030.00811.27
5.4.320.0120.02014.05
5.4.310.0290.01613.88
5.4.300.0240.01613.85
5.4.290.0250.01613.90
5.4.280.0230.02013.88
5.4.270.0220.01613.82
5.4.260.0230.01813.77
5.4.250.0180.01513.83
5.4.240.0200.01713.76
5.4.230.0120.01913.83
5.4.220.0190.01913.82
5.4.210.0170.01613.61
5.4.200.0190.01913.77
5.4.190.0140.02013.73
5.4.180.0130.01813.61
5.4.170.0200.01413.50
5.4.160.0210.01713.80
5.4.150.0130.01313.78
5.4.140.0210.01513.72
5.4.130.0170.01413.74
5.4.120.0200.01713.41
5.4.110.0190.02013.42
5.4.100.0140.01613.40
5.4.90.0200.01613.56
5.4.80.0240.01513.35
5.4.70.0090.02013.60
5.4.60.0290.01513.37
5.4.50.0210.01313.41
5.4.40.0210.01213.27
5.4.30.0250.01113.23
5.4.20.0290.01713.39
5.4.10.0180.01513.46
5.4.00.0190.01913.27
5.3.290.0130.01613.58
5.3.280.0120.01613.42
5.3.270.0130.01913.40
5.3.260.0200.01813.44
5.3.250.0170.01913.35
5.3.240.0240.01613.23
5.3.230.0210.01513.36
5.3.220.0130.01913.11
5.3.210.0210.01713.10
5.3.200.0160.01813.13
5.3.190.0090.01713.07
5.3.180.0210.01513.18
5.3.170.0150.01513.20
5.3.160.0240.01913.14
5.3.150.0220.01513.13
5.3.140.0140.01513.05
5.3.130.0380.01813.06
5.3.120.0290.02013.05
5.3.110.0210.01813.09
5.3.100.0210.01913.00
5.3.90.0180.01612.99
5.3.80.0220.01712.89
5.3.70.0180.01812.73
5.3.60.0270.01412.88
5.3.50.0100.01612.71
5.3.40.0250.01712.61
5.3.30.0070.01812.79
5.3.20.0220.01812.61
5.3.10.0280.01912.52
5.3.00.0280.01912.43
5.2.170.0400.03317.45
5.2.160.0530.03317.45
5.2.150.0500.04017.15
5.2.140.0130.03716.99
5.2.130.0330.03016.99
5.2.120.0400.02016.99
5.2.110.0500.02016.99
5.2.100.0530.03716.99
5.2.90.0130.03316.98
5.2.80.0570.02316.98
5.2.70.0570.03016.72
5.2.60.0570.03716.71
5.2.50.0770.03316.52
5.2.40.0370.03016.52
5.2.30.0530.04016.52
5.2.20.0730.04716.52
5.2.10.0400.03316.50
5.2.00.0570.03016.50
5.1.60.0730.02016.50
5.1.50.0370.03716.27
5.1.40.0430.04716.27
5.1.30.0400.03016.27
5.1.20.0830.03716.26
5.1.10.0230.04716.26
5.1.00.0370.03316.26
5.0.50.0370.05016.26
5.0.40.0030.02316.26
5.0.30.0230.04016.26
5.0.20.0170.02016.25
5.0.10.0300.02716.25
5.0.00.0270.04316.25
4.4.90.0230.02016.72
4.4.80.0170.01316.52
4.4.70.0070.02016.51
4.4.60.0170.01316.51
4.4.50.0030.02016.50
4.4.40.0270.02716.28
4.4.30.0230.01316.27
4.4.20.0100.01716.26
4.4.10.0000.01716.26
4.4.00.0300.01716.26
4.3.110.0100.01316.26
4.3.100.0200.01716.26
4.3.90.0330.02016.25
4.3.80.0430.04316.25
4.3.70.0230.01716.25
4.3.60.0200.01316.25
4.3.50.0400.01716.25
4.3.40.0000.03016.25
4.3.30.0170.01016.25
4.3.20.0030.01716.25
4.3.10.0200.04016.25
4.3.00.0000.02316.25

preferences:
38.47 ms | 401 KiB | 5 Q