3v4l.org

run code in 300+ PHP versions simultaneously
<?php function generate_alpha_num_id($x){ return 0+$x; // add zero to convert strings to integers (effectively trimming leading zeros) } echo generate_alpha_num_id(010100001); // send parameter as 2129921 base 8 (octal) echo "\n---\n"; echo generate_alpha_num_id('010100001'); // send parameter as string to avoid octal interpretation

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)
8.5.10.0110.00816.57
8.5.00.0200.00919.76
8.4.150.0020.00114.05
8.4.140.0120.00917.16
8.4.130.0080.00217.85
8.4.120.0110.01020.45
8.4.110.0120.01022.27
8.4.100.0130.00817.67
8.4.90.0100.01118.68
8.4.80.0070.00219.48
8.4.70.0040.00517.71
8.4.60.0100.01218.49
8.4.50.0110.00918.48
8.4.40.0070.01119.22
8.4.30.0070.01317.27
8.4.20.0100.01019.23
8.4.10.0060.00317.76
8.3.280.0140.00618.35
8.3.270.0100.01016.24
8.3.260.0140.00616.40
8.3.250.0120.00618.62
8.3.240.0080.00716.49
8.3.230.0130.00716.31
8.3.220.0060.00417.30
8.3.210.0070.01116.55
8.3.200.0050.00416.61
8.3.190.0110.00816.51
8.3.180.0060.00218.31
8.3.170.0140.00018.84
8.3.160.0110.00718.60
8.3.150.0120.00618.24
8.3.140.0110.00417.27
8.3.130.0040.00418.59
8.3.120.0090.00620.75
8.3.110.0040.00420.94
8.3.100.0130.00724.06
8.3.90.0070.01126.77
8.3.80.0030.00618.43
8.3.70.0150.00318.43
8.3.60.0040.01118.39
8.3.50.0070.01016.48
8.3.40.0040.01118.97
8.3.30.0060.01518.84
8.3.20.0070.00021.91
8.3.10.0040.00421.77
8.3.00.0040.00419.55
8.2.290.0120.00620.08
8.2.280.0060.00218.43
8.2.270.0000.01918.77
8.2.260.0110.00716.61
8.2.250.0040.00416.46
8.2.240.0040.00418.63
8.2.230.0060.01322.58
8.2.220.0060.00337.54
8.2.210.0090.00626.77
8.2.200.0000.01116.50
8.2.190.0120.00916.58
8.2.180.0040.01116.32
8.2.170.0100.00322.96
8.2.160.0070.00720.35
8.2.150.0120.00624.18
8.2.140.0040.00424.66
8.2.130.0000.00720.47
8.2.120.0000.00726.35
8.2.110.0080.00320.55
8.2.100.0070.00417.78
8.2.90.0030.00517.49
8.2.80.0000.00719.28
8.2.70.0040.00417.93
8.2.60.0060.00317.93
8.2.50.0060.00318.10
8.2.40.0040.00420.65
8.2.30.0050.00219.07
8.2.20.0070.00018.04
8.2.10.0000.00717.91
8.2.00.0080.00017.93
8.1.330.0100.00921.96
8.1.320.0120.00716.07
8.1.310.0030.01318.32
8.1.300.0000.01119.98
8.1.290.0030.00630.84
8.1.280.0110.00725.92
8.1.270.0040.00422.05
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0080.00423.91
8.1.230.0120.00020.80
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0040.00417.23
8.1.190.0000.00816.98
8.1.180.0000.00818.10
8.1.170.0090.00318.52
8.1.160.0060.00318.81
8.1.150.0040.00420.27
8.1.140.0000.00717.59
8.1.130.0030.00318.92
8.1.120.0000.00717.24
8.1.110.0050.00517.22
8.1.100.0000.00817.34
8.1.90.0080.00017.27
8.1.80.0070.00317.25
8.1.70.0070.00017.26
8.1.60.0040.00417.52
8.1.50.0040.00717.50
8.1.40.0030.00517.49
8.1.30.0050.00317.70
8.1.20.0030.00617.50
8.1.10.0040.00417.48
8.1.00.0070.00417.39
8.0.300.0000.00721.82
8.0.290.0000.00716.75
8.0.280.0070.00018.40
8.0.270.0070.00017.26
8.0.260.0000.00716.82
8.0.250.0000.00816.88
8.0.240.0000.00816.94
8.0.230.0040.00416.93
8.0.220.0030.00316.80
8.0.210.0030.00316.80
8.0.200.0000.00716.85
8.0.190.0030.00716.83
8.0.180.0030.00416.87
8.0.170.0050.00316.87
8.0.160.0070.00016.88
8.0.150.0030.00516.61
8.0.140.0000.00716.67
8.0.130.0050.00013.28
8.0.120.0030.00516.83
8.0.110.0050.00316.84
8.0.100.0020.00516.81
8.0.90.0000.00816.83
8.0.80.0070.01116.88
8.0.70.0040.00416.79
8.0.60.0040.00416.80
8.0.50.0030.00516.88
8.0.30.0070.01216.93
8.0.20.0110.00817.40
8.0.10.0000.00716.86
8.0.00.0080.01216.58
7.4.330.0050.00015.55
7.4.320.0060.00016.46
7.4.300.0030.00316.55
7.4.290.0030.00316.57
7.4.280.0030.00616.29
7.4.270.0000.00716.55
7.4.260.0030.00316.43
7.4.250.0000.00816.30
7.4.240.0040.00416.52
7.4.230.0070.00016.54
7.4.220.0040.00416.44
7.4.210.0100.00516.49
7.4.200.0070.00016.42
7.4.160.0090.00816.36
7.4.150.0150.00317.40
7.4.140.0120.00717.86
7.4.130.0150.00416.33
7.4.120.0120.00916.53
7.4.110.0060.01116.60
7.4.100.0120.00816.38
7.4.90.0140.00416.52
7.4.80.0120.00619.39
7.4.70.0040.01416.44
7.4.60.0150.00816.30
7.4.50.0090.00216.51
7.4.40.0100.00616.58
7.4.00.0080.00814.80
7.3.330.0030.00313.08
7.3.320.0050.00013.30
7.3.310.0000.00716.31
7.3.300.0040.00416.17
7.3.290.0030.00316.16
7.3.280.0090.00616.34
7.3.270.0180.00017.40
7.3.260.0110.00716.42
7.3.240.0100.00916.33
7.3.230.0100.00716.31
7.3.210.0100.00716.54
7.3.200.0050.01116.21
7.3.190.0090.00616.32
7.3.180.0070.01316.29
7.3.170.0030.01416.29
7.3.160.0110.00516.37
7.3.120.0020.01614.91
7.3.110.0040.01114.64
7.3.100.0000.01415.02
7.3.90.0090.00914.88
7.3.80.0070.00715.01
7.3.70.0040.00414.82
7.3.60.0040.01114.90
7.3.50.0030.00614.59
7.3.40.0070.00714.70
7.3.30.0130.00314.85
7.3.20.0040.01216.39
7.3.10.0060.00616.54
7.3.00.0110.00416.77
7.2.330.0080.00816.59
7.2.320.0140.00716.61
7.2.310.0170.00016.46
7.2.300.0070.01116.45
7.2.290.0030.01316.44
7.2.250.0110.00415.21
7.2.240.0120.00914.87
7.2.230.0000.01415.14
7.2.220.0040.00815.05
7.2.210.0000.01714.99
7.2.200.0090.00014.59
7.2.190.0090.00014.94
7.2.180.0090.00014.88
7.2.170.0000.01614.82
7.2.60.0000.01016.90
7.2.20.0110.01019.54
7.2.10.0090.01019.59
7.2.00.0080.01219.56
7.1.330.0030.01015.59
7.1.320.0000.00915.75
7.1.310.0110.00415.67
7.1.300.0000.01515.64
7.1.290.0040.01215.81
7.1.280.0130.00315.51
7.1.270.0030.00615.36
7.1.260.0070.00715.45
7.1.200.0070.00415.81
7.1.140.0060.01118.11
7.1.130.0080.01018.54
7.1.120.0080.01018.60
7.1.110.0090.00917.81
7.1.100.0060.01117.77
7.1.90.0080.01317.87
7.1.80.0070.00817.85
7.1.70.0090.01116.98
7.1.60.0280.01535.05
7.1.50.0230.01834.55
7.1.40.0280.01334.36
7.1.30.0230.01434.45
7.1.20.0240.01134.46
7.1.10.0060.01016.11
7.1.00.0070.01216.23

preferences:
37.33 ms | 403 KiB | 5 Q