3v4l.org

run code in 300+ PHP versions simultaneously
<?php function multiID($n=32) { for ($x=$s=$r=0; $x<$n; $x++) { $c = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890'; if (($x<$n) && ($x > 0) && ($s < 2)) { $c .= '-_'; } $g = substr($c, mt_rand(0, strlen($c) - 1), 1); $r .= $g; if (($g == '_') || ($g == '-')) { $s++; } } return $r; } echo multiID(4);

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.0060.00914.92
7.4.00.0090.00615.05
7.3.130.0060.01214.71
7.3.120.0140.00014.87
7.3.110.0060.01014.91
7.3.100.0140.00014.67
7.3.90.0090.00614.70
7.3.80.0080.00814.46
7.3.70.0030.01014.54
7.3.60.0110.00414.75
7.3.50.0070.00714.69
7.3.40.0100.00314.78
7.3.30.0000.01514.95
7.3.20.0030.01416.54
7.3.10.0110.00916.46
7.3.00.0130.00616.39
7.2.260.0060.01014.91
7.2.250.0090.00615.16
7.2.240.0060.00615.04
7.2.230.0030.00714.83
7.2.220.0040.01214.92
7.2.210.0060.00615.02
7.2.200.0000.01214.95
7.2.190.0000.01514.93
7.2.180.0110.00415.17
7.2.170.0060.00614.90
7.2.160.0030.01214.94
7.2.150.0080.00316.97
7.2.140.0030.00916.89
7.2.130.0090.00916.64
7.2.120.0110.00716.71
7.2.110.0050.01316.60
7.2.100.0070.00816.99
7.2.90.0080.00916.89
7.2.80.0050.01116.79
7.2.70.0110.00716.76
7.2.60.0090.00816.72
7.2.50.0080.01117.05
7.2.40.0050.01016.81
7.2.30.0060.00816.91
7.2.20.0090.00516.88
7.2.10.0070.01016.64
7.2.00.0090.00617.63
7.1.330.0070.00715.67
7.1.320.0000.01715.42
7.1.310.0120.00315.85
7.1.300.0000.01116.05
7.1.290.0060.00615.72
7.1.280.0040.01115.75
7.1.270.0060.00315.72
7.1.260.0030.00715.61
7.1.250.0050.00915.71
7.1.240.0070.00715.73
7.1.230.0030.01016.02
7.1.220.0030.01015.69
7.1.210.0000.01215.55
7.1.200.0040.01115.54
7.1.190.0060.01215.80
7.1.180.0100.00315.53
7.1.170.0070.00415.55
7.1.160.0030.00815.72
7.1.150.0090.00615.75
7.1.140.0080.00415.70
7.1.130.0030.01015.63
7.1.120.0070.00715.88
7.1.110.0030.01016.00
7.1.100.0030.00915.96
7.1.90.0030.01015.88
7.1.80.0080.00315.95
7.1.70.0060.00716.50
7.1.60.0100.00817.60
7.1.50.0120.00716.35
7.1.40.0030.00915.86
7.1.30.0030.00715.71
7.1.20.0060.00615.87
7.1.10.0060.00615.83
7.1.00.0050.01819.02
7.0.330.0030.01015.20
7.0.320.0040.00715.04
7.0.310.0100.00315.32
7.0.300.0070.00715.45
7.0.290.0070.00715.52
7.0.280.0040.00415.42
7.0.270.0100.00715.32
7.0.260.0000.01115.33
7.0.250.0080.00415.40
7.0.240.0070.00715.50
7.0.230.0040.00415.42
7.0.220.0060.00615.54
7.0.210.0050.00515.32
7.0.200.0070.00716.13
7.0.190.0040.01115.32
7.0.180.0080.00315.18
7.0.170.0050.00315.20
7.0.160.0070.00715.45
7.0.150.0080.00615.23
7.0.140.0060.04218.62
7.0.130.0100.00315.49
7.0.120.0100.00315.52
7.0.110.0030.01015.43
7.0.100.0080.00315.50
7.0.90.0000.01415.36
7.0.80.0000.01215.51
7.0.70.0030.00715.31
7.0.60.0070.04017.66
7.0.50.0030.03716.57
7.0.40.0040.02516.86
7.0.30.0100.02516.84
7.0.20.0250.03716.79
7.0.10.0170.02316.70
7.0.00.0050.02316.85
5.6.400.0030.01014.55
5.6.390.0100.00014.24
5.6.380.0040.01114.64
5.6.370.0130.00314.34
5.6.360.0030.01014.26
5.6.350.0030.00614.29
5.6.340.0040.00814.64
5.6.330.0120.00314.68
5.6.320.0150.00014.12
5.6.310.0070.01014.64
5.6.300.0100.00614.50
5.6.290.0070.00714.39
5.6.280.0060.04017.85
5.6.270.0000.01714.80
5.6.260.0060.00614.00
5.6.250.0110.00014.25
5.6.240.0050.00514.28
5.6.230.0050.00514.37
5.6.220.0070.01014.39
5.6.210.0070.03017.45
5.6.200.0080.02816.27
5.6.190.0130.04317.55
5.6.180.1990.02017.48
5.6.170.0250.02517.44
5.6.160.0030.02617.61
5.6.150.0070.02216.23
5.6.140.0120.04016.26
5.6.130.0090.04316.33
5.6.120.0050.04917.95
5.6.110.0130.03817.56
5.6.100.0120.04317.75
5.6.90.0070.04517.54
5.6.80.0050.03017.26
5.6.70.0080.02017.32
5.6.60.0070.00714.31
5.6.50.0070.00314.23
5.6.40.0040.01114.31
5.6.30.0070.00714.26
5.6.20.0060.00914.41
5.6.10.0000.01614.27
5.6.00.0000.01514.40
5.5.380.0000.01714.29
5.5.370.0070.00414.46
5.5.360.0090.00314.67
5.5.350.0180.03817.27
5.5.340.0030.04816.18
5.5.330.0080.03817.28
5.5.320.0120.02517.09
5.5.310.0150.02717.35
5.5.300.0020.02516.18
5.5.290.0080.03416.01
5.5.280.0070.04717.65
5.5.270.0070.04817.61
5.5.260.0100.03517.33
5.5.250.0060.03217.25
5.5.240.0050.04317.22
5.5.230.0060.00914.24
5.5.220.0120.00414.16
5.5.210.0090.00613.96
5.5.200.0070.00714.01
5.5.190.0090.00313.93
5.5.180.0110.00314.20
5.5.170.0070.00714.43
5.5.160.0090.00314.24
5.5.150.0110.00314.45
5.5.140.0070.01014.23
5.5.130.0060.00614.50
5.5.120.0090.00314.13
5.5.110.0000.01514.09
5.5.100.0030.00613.97
5.5.90.0000.01814.39
5.5.80.0100.00714.14
5.5.70.0100.00714.21
5.5.60.0100.00713.94
5.5.50.0090.00913.92
5.5.40.0070.00714.30
5.5.30.0000.01314.20
5.5.20.0030.01014.43
5.5.10.0060.00614.26
5.5.00.0140.00313.96
5.4.450.0180.03515.28
5.4.440.0140.02515.08
5.4.430.0120.04115.35
5.4.420.0130.02814.94
5.4.410.0180.02415.07
5.4.400.0140.03814.73
5.4.390.0130.03615.00
5.4.380.0150.03315.09
5.4.370.0130.03715.06
5.4.360.0130.03814.88
5.4.350.0140.03915.12
5.4.340.0120.04214.92
5.4.330.0060.00610.64
5.4.320.0070.02414.99
5.4.310.0120.01814.96
5.4.300.0070.03014.88
5.4.290.0120.02214.92
5.4.280.0110.01915.17
5.4.270.0100.02214.82
5.4.260.0100.04314.97
5.4.250.0080.03714.95
5.4.240.0130.03314.94
5.4.230.0130.02514.91
5.4.220.0080.02515.13
5.4.210.0100.02214.83
5.4.200.0130.01614.94
5.4.190.0080.02714.88
5.4.180.0070.02714.89
5.4.170.0130.01815.02
5.4.160.0130.01615.04
5.4.150.0130.02214.81
5.4.140.0080.02113.54
5.4.130.0100.02413.51
5.4.120.0100.02013.52
5.4.110.0110.01913.70
5.4.100.0130.02213.67
5.4.90.0210.03213.67
5.4.80.0160.03213.49
5.4.70.0110.04113.77
5.4.60.0140.03713.75
5.4.50.0110.02613.74
5.4.40.0200.03513.83
5.4.30.0160.03913.80
5.4.20.0140.03413.71
5.4.10.0140.02613.68
5.4.00.0130.02013.45
5.3.290.0100.02312.71
5.3.280.0100.02612.55
5.3.270.0170.01812.60
5.3.260.0150.02012.64
5.3.250.0140.02012.64
5.3.240.0140.02112.55
5.3.230.0150.02212.53
5.3.220.0120.02112.53
5.3.210.0110.02312.44
5.3.200.0150.01812.55
5.3.190.0100.03112.46
5.3.180.0200.02712.49
5.3.170.0160.04212.63
5.3.160.0190.03112.67
5.3.150.0160.03912.61
5.3.140.0240.03412.55
5.3.130.0160.02812.46
5.3.120.0230.03212.56
5.3.110.0190.03912.51
5.3.100.0130.02312.42
5.3.90.0180.03512.31
5.3.80.0160.03412.19
5.3.70.0150.03512.08
5.3.60.0190.02212.14
5.3.50.0160.02112.19
5.3.40.0130.02412.14
5.3.30.0190.03712.29
5.3.20.0130.02612.08
5.3.10.0130.04111.96
5.3.00.0130.03011.93
5.2.170.0170.04012.13
5.2.160.0230.05712.13
5.2.150.0170.05012.13
5.2.140.0170.05712.13
5.2.130.0170.06012.13
5.2.120.0230.05312.13
5.2.110.0200.05312.13
5.2.100.0200.06012.13
5.2.90.0230.03312.13
5.2.80.0170.04312.13
5.2.70.0170.06012.13
5.2.60.0230.03012.13
5.2.50.0170.06312.13
5.2.40.0100.06012.13
5.2.30.0230.05312.13
5.2.20.0130.06012.13
5.2.10.0170.04712.13
5.2.00.0100.06312.13
5.1.60.0170.05012.13
5.1.50.0100.03012.13
5.1.40.0170.04712.13
5.1.30.0100.03712.13
5.1.20.0170.05012.13
5.1.10.0130.05312.13
5.1.00.0100.03712.13
5.0.50.0170.03012.13
5.0.40.0130.04012.13
5.0.30.0100.06012.13
5.0.20.0070.03712.13
5.0.10.0100.02012.13
5.0.00.0070.04012.13
4.4.90.0100.03012.13
4.4.80.0100.03312.13
4.4.70.0130.03312.13
4.4.60.0170.03012.13
4.4.50.0070.04012.13
4.4.40.0070.04312.13
4.4.30.0070.02012.13
4.4.20.0070.01712.13
4.4.10.0100.03312.13
4.4.00.0070.05712.13
4.3.110.0070.03712.13
4.3.100.0070.03012.13
4.3.90.0070.03312.13
4.3.80.0170.04312.13
4.3.70.0100.02712.13
4.3.60.0100.03312.13
4.3.50.0070.02312.13
4.3.40.0130.05012.13
4.3.30.0070.03712.13
4.3.20.0030.03712.13
4.3.10.0070.02712.13
4.3.00.0000.03712.13

preferences:
36.79 ms | 401 KiB | 5 Q