3v4l.org

run code in 300+ PHP versions simultaneously
<?php $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789"; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < 8; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } echo implode($pass); //turn the array into a string

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.0100.00614.77
7.4.00.0100.00914.78
7.3.130.0110.00715.02
7.3.120.0070.01114.81
7.3.110.0090.01114.93
7.3.100.0000.01314.74
7.3.90.0070.00914.80
7.3.80.0040.01214.75
7.3.70.0080.00614.71
7.3.60.0090.00514.70
7.3.50.0020.01314.77
7.3.40.0110.00714.79
7.3.30.0030.00814.81
7.3.20.0120.00116.44
7.3.10.0100.00216.80
7.3.00.0030.00916.66
7.2.260.0030.01615.23
7.2.250.0110.00815.13
7.2.240.0060.01215.03
7.2.230.0080.00715.27
7.2.220.0060.00914.96
7.2.210.0080.01014.86
7.2.200.0050.01015.04
7.2.190.0100.00515.02
7.2.180.0050.00715.05
7.2.170.0040.01215.02
7.2.160.0040.00814.97
7.2.150.0100.00016.96
7.2.140.0070.00717.07
7.2.130.0060.00616.98
7.2.120.0070.00716.99
7.2.110.0080.00416.99
7.2.100.0040.01116.70
7.2.90.0090.00616.93
7.2.80.0030.01016.73
7.2.70.0070.00716.96
7.2.60.0120.00316.88
7.2.50.0000.01716.75
7.2.40.0000.01216.91
7.2.30.0140.00316.93
7.2.20.0100.00717.05
7.2.10.0040.01516.79
7.2.00.0040.01018.02
7.1.330.0040.00915.84
7.1.320.0070.00715.82
7.1.310.0080.00615.63
7.1.300.0080.00915.76
7.1.290.0030.01215.72
7.1.280.0120.00315.87
7.1.270.0020.00915.82
7.1.260.0000.01415.75
7.1.250.0060.00615.93
7.1.240.0070.00715.84
7.1.230.0070.00315.65
7.1.220.0070.00715.80
7.1.210.0040.01215.85
7.1.200.0080.00415.77
7.1.190.0100.00315.90
7.1.180.0140.00315.84
7.1.170.0030.00915.77
7.1.160.0070.01015.76
7.1.150.0100.00715.80
7.1.140.0030.01215.66
7.1.130.0070.00715.63
7.1.120.0040.01115.49
7.1.110.0030.01415.61
7.1.100.0120.00315.66
7.1.90.0150.00015.84
7.1.80.0070.00715.93
7.1.70.0060.00816.53
7.1.60.0090.01017.48
7.1.50.0040.00916.23
7.1.40.0110.00316.04
7.1.30.0060.00615.82
7.1.20.0130.00315.52
7.1.10.0030.00715.73
7.1.00.0060.02018.94
7.0.330.0070.00315.43
7.0.320.0030.01015.60
7.0.310.0000.00915.41
7.0.300.0000.01415.10
7.0.290.0040.01115.45
7.0.280.0040.00815.61
7.0.270.0060.00615.47
7.0.260.0030.01015.36
7.0.250.0000.01415.28
7.0.240.0030.00615.64
7.0.230.0000.01315.54
7.0.220.0030.01415.32
7.0.210.0070.00715.55
7.0.200.0050.00715.99
7.0.190.0030.01115.45
7.0.180.0030.01015.52
7.0.170.0040.00415.47
7.0.160.0030.01315.43
7.0.150.0090.00615.45
7.0.140.0070.03718.87
7.0.130.0030.01315.49
7.0.120.0060.00615.40
7.0.110.0030.01015.18
7.0.100.0090.04517.77
7.0.90.0030.05717.77
7.0.80.0180.04317.71
7.0.70.0100.04117.73
7.0.60.0070.04117.66
7.0.50.0100.04217.82
7.0.40.0070.04016.83
7.0.30.0110.03816.73
7.0.20.0100.04016.62
7.0.10.0080.04116.84
7.0.00.0100.04116.65
5.6.400.0080.00514.25
5.6.390.0040.01114.32
5.6.380.0100.00714.44
5.6.370.0070.01014.80
5.6.360.0060.01214.64
5.6.350.0000.01414.63
5.6.340.0100.00314.38
5.6.330.0000.00914.17
5.6.320.0000.01414.57
5.6.310.0000.01714.77
5.6.300.0040.01114.17
5.6.290.0030.01314.71
5.6.280.0020.04317.87
5.6.270.0070.00714.45
5.6.260.0030.00914.62
5.6.250.0070.03517.50
5.6.240.0050.03017.55
5.6.230.0040.04617.64
5.6.220.0100.03217.55
5.6.210.0090.03117.38
5.6.200.0050.04017.84
5.6.190.0120.02717.85
5.6.180.0050.03017.71
5.6.170.0050.04117.65
5.6.160.0050.04417.77
5.6.150.0120.03717.82
5.6.140.0100.04317.93
5.6.130.0040.05117.80
5.6.120.0070.04417.64
5.6.110.0030.04517.70
5.6.100.0050.02917.72
5.6.90.0050.02717.69
5.6.80.0070.03217.44
5.6.70.0050.02717.51
5.6.60.0050.02217.46
5.6.50.0020.02317.40
5.6.40.0060.04317.48
5.6.30.0050.04217.49
5.6.20.0070.04217.24
5.6.10.0060.03217.34
5.6.00.0070.02917.36
5.5.380.0150.03217.33
5.5.370.0100.04017.32
5.5.360.0050.02517.52
5.5.350.0030.05017.42
5.5.340.0080.03117.69
5.5.330.0030.04617.65
5.5.320.0090.04017.71
5.5.310.0050.04817.65
5.5.300.0120.02717.48
5.5.290.0070.04317.62
5.5.280.0090.04217.76
5.5.270.0090.04517.53
5.5.260.0090.04717.60
5.5.250.0050.04017.54
5.5.240.0070.03217.48
5.5.230.0060.03517.26
5.5.220.0050.04317.34
5.5.210.0060.01817.15
5.5.200.0050.02517.37
5.5.190.0140.03117.25
5.5.180.0020.04617.17
5.5.170.0060.00614.34
5.5.160.0110.03017.23
5.5.150.0040.04117.31
5.5.140.0050.04017.34
5.5.130.0050.04717.26
5.5.120.0090.04417.21
5.5.110.0050.03117.30
5.5.100.0110.04017.28
5.5.90.0060.02517.16
5.5.80.0000.02717.29
5.5.70.0000.05117.06
5.5.60.0060.03017.24
5.5.50.0130.04117.27
5.5.40.0110.03317.05
5.5.30.0080.04017.09
5.5.20.0120.03717.17
5.5.10.0030.04517.13
5.5.00.0080.03917.08
5.4.450.0070.02915.35
5.4.440.0090.04015.47
5.4.430.0160.03315.51
5.4.420.0040.03015.48
5.4.410.0050.02515.42
5.4.400.0020.02415.32
5.4.390.0090.02315.27
5.4.380.0040.04215.31
5.4.370.0070.03215.35
5.4.360.0070.03915.31
5.4.350.0070.04115.28
5.4.340.0070.02915.32
5.4.330.0040.00711.59
5.4.320.0050.03815.19
5.4.310.0050.04215.19
5.4.300.0050.03215.36
5.4.290.0020.02615.34
5.4.280.0070.03915.26
5.4.270.0140.02515.20
5.4.260.0020.03815.28
5.4.250.0050.03915.35
5.4.240.0010.03815.30
5.4.230.0060.04115.37
5.4.220.0010.03415.34
5.4.210.0050.03015.31
5.4.200.0080.03815.35
5.4.190.0110.02015.34
5.4.180.0130.02515.30
5.4.170.0100.03515.40
5.4.160.0060.03815.34
5.4.150.0070.03515.25
5.4.140.0030.04213.83
5.4.130.0080.03313.96
5.4.120.0050.02113.93
5.4.110.0030.02313.96
5.4.100.0110.02413.97
5.4.90.0030.02313.92
5.4.80.0020.03813.97
5.4.70.0010.02813.96
5.4.60.0050.02013.90
5.4.50.0070.02213.88
5.4.40.0070.01813.96
5.4.30.0050.02113.92
5.4.20.0060.02113.90
5.4.10.0040.02713.99
5.4.00.0050.02813.68
5.3.290.0050.03813.08
5.3.280.0070.03913.08
5.3.270.0130.01513.01
5.3.260.0070.04013.07
5.3.250.0030.03813.03
5.3.240.0090.03813.09
5.3.230.0050.02313.09
5.3.220.0030.02213.00
5.3.210.0030.02413.07
5.3.200.0080.01713.05
5.3.190.0060.03013.00
5.3.180.0030.02013.05
5.3.170.0100.02513.05
5.3.160.0050.02213.00
5.3.150.0070.01913.04
5.3.140.0030.02013.07
5.3.130.0030.02213.04
5.3.120.0080.01813.06
5.3.110.0040.02413.04
5.3.100.0060.02012.72
5.3.90.0030.02912.79
5.3.80.0020.02412.78
5.3.70.0050.02312.78
5.3.60.0000.02512.79
5.3.50.0000.03612.77
5.3.40.0050.04212.77
5.3.30.0050.03512.66
5.3.20.0050.02412.62
5.3.10.0050.02312.61
5.3.00.0080.03212.54
5.2.170.0070.05711.13
5.2.160.0030.06311.06
5.2.150.0030.06311.06
5.2.140.0100.03011.09
5.2.130.0000.03310.93
5.2.120.0100.05010.98
5.2.110.0000.04310.96
5.2.100.0070.05010.95
5.2.90.0070.06010.89
5.2.80.0130.05011.02
5.2.70.0030.06311.08
5.2.60.0030.03311.07
5.2.50.0070.05711.04
5.2.40.0030.02310.84
5.2.30.0030.06310.72
5.2.20.0030.06011.00
5.2.10.0100.05710.94
5.2.00.0030.06310.77
5.1.60.0030.05710.00
5.1.50.0000.04710.00
5.1.40.0000.04710.00
5.1.30.0170.04710.36
5.1.20.0070.05710.30
5.1.10.0030.04710.09
5.1.00.0100.04710.14
5.0.50.0000.0338.94
5.0.40.0030.0378.94
5.0.30.0030.0408.94
5.0.20.0100.0378.94
5.0.10.0100.0238.94
5.0.00.0000.0608.94
4.4.90.0030.0308.94
4.4.80.0000.0138.94
4.4.70.0030.0338.94
4.4.60.0000.0378.94
4.4.50.0030.0338.94
4.4.40.0030.0338.94
4.4.30.0000.0338.94
4.4.20.0000.0308.94
4.4.10.0030.0438.94
4.4.00.0030.0278.94
4.3.110.0030.0378.94
4.3.100.0000.0378.94
4.3.90.0030.0338.94
4.3.80.0000.0438.94
4.3.70.0000.0378.94
4.3.60.0030.0338.94
4.3.50.0070.0308.94
4.3.40.0030.0478.94
4.3.30.0000.0338.94
4.3.20.0000.0308.94
4.3.10.0030.0278.94
4.3.00.0000.0178.94

preferences:
43 ms | 401 KiB | 5 Q