3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 43; $substitutes = range('a', 'j'); $formatted = sprintf('%010d', $number); $string = preg_replace_callback('.', function ($m) use ($substitutes) { return $substitutes[$m[0]]; }, $formatted); echo $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)
8.3.70.0140.00416.50
8.3.60.0030.01216.61
8.3.50.0220.00716.54
8.3.40.0070.01018.71
8.3.30.0040.01118.71
8.3.20.0060.00318.77
8.3.10.0030.00518.73
8.3.00.0030.00619.26
8.2.180.0140.00416.88
8.2.170.0110.00422.96
8.2.160.0090.00618.96
8.2.150.0100.00625.66
8.2.140.0090.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00420.75
8.2.110.0070.00420.35
8.2.100.0060.00617.78
8.2.90.0040.00417.88
8.2.80.0050.00318.78
8.2.70.0030.00517.60
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0040.00419.23
8.2.30.0080.00017.77
8.2.20.0090.00017.66
8.2.10.0000.00717.63
8.2.00.0000.00817.70
8.1.280.0040.01125.92
8.1.270.0040.00423.99
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0030.00618.93
8.1.230.0140.00017.77
8.1.220.0040.00417.76
8.1.210.0060.00318.77
8.1.200.0000.00917.23
8.1.190.0040.00417.23
8.1.180.0030.00518.10
8.1.170.0040.00418.82
8.1.160.0030.00518.93
8.1.150.0040.00418.64
8.1.140.0000.00817.36
8.1.130.0000.00717.45
8.1.120.0030.00317.38
8.1.110.0000.00717.34
8.1.100.0000.00817.45
8.1.90.0040.00417.45
8.1.80.0040.00317.46
8.1.70.0000.00717.39
8.1.60.0060.00317.65
8.1.50.0070.00017.54
8.1.40.0000.00817.50
8.1.30.0000.00917.62
8.1.20.0060.00317.61
8.1.10.0040.00417.41
8.1.00.0000.00717.46
8.0.300.0040.00418.77
8.0.290.0000.00816.71
8.0.280.0000.00718.42
8.0.270.0070.00017.36
8.0.260.0000.00616.88
8.0.250.0050.00316.97
8.0.240.0040.00416.97
8.0.230.0000.00716.93
8.0.220.0000.00716.89
8.0.210.0030.00316.95
8.0.200.0000.00616.96
8.0.190.0040.00417.05
8.0.180.0060.00716.99
8.0.170.0060.00316.88
8.0.160.0040.00416.94
8.0.150.0040.00416.79
8.0.140.0050.00316.87
8.0.130.0000.00513.38
8.0.120.0030.00616.82
8.0.110.0000.00816.98
8.0.100.0020.00616.83
8.0.90.0070.00016.78
8.0.80.0110.01017.00
8.0.70.0040.00417.00
8.0.60.0040.00416.82
8.0.50.0000.00916.78
8.0.30.0080.01216.89
8.0.20.0210.01317.27
8.0.10.0050.00317.06
8.0.00.0120.00716.65
7.4.330.0060.00013.03
7.4.320.0030.00316.45
7.4.300.0030.00316.59
7.4.290.0000.00716.48
7.4.280.0070.00016.37
7.4.270.0000.00616.51
7.4.260.0050.00013.29
7.4.250.0040.00416.50
7.4.240.0030.00316.49
7.4.230.0060.00316.46
7.4.220.0090.00916.53
7.4.210.0030.01216.51
7.4.200.0000.00716.30
7.4.190.0040.00416.45
7.4.160.0030.01216.49
7.4.150.0130.00416.70
7.4.140.0030.01416.57
7.4.130.0150.00816.55
7.4.120.0120.00916.70
7.4.110.0110.00716.55
7.4.100.0130.00916.71
7.4.90.0070.01016.48
7.4.80.0120.00619.39
7.4.70.0060.01216.40
7.4.60.0120.00616.65
7.4.50.0000.00416.63
7.4.40.0070.00816.51
7.4.30.0100.00616.44
7.4.00.0060.00914.89
7.3.330.0030.00313.19
7.3.320.0030.00313.41
7.3.310.0030.00316.27
7.3.300.0060.00016.41
7.3.290.0100.00416.33
7.3.280.0140.00516.40
7.3.270.0030.01416.52
7.3.260.0140.00316.78
7.3.250.0090.00916.49
7.3.240.0090.01316.56
7.3.230.0100.00716.41
7.3.210.0030.01316.54
7.3.200.0070.01016.45
7.3.190.0100.01416.52
7.3.180.0110.00516.45
7.3.170.0090.00616.50
7.3.160.0100.00716.54
7.3.120.0110.00714.64
7.3.10.0030.01216.77
7.3.00.0000.01216.71
7.2.330.0070.01016.67
7.2.320.0160.01016.60
7.2.310.0090.00916.83
7.2.300.0060.01916.58
7.2.290.0120.00616.76
7.2.130.0130.00316.62
7.2.120.0000.01417.02
7.2.110.0060.00616.47
7.2.100.0030.01017.05
7.2.90.0000.01217.05
7.2.80.0000.01016.73
7.2.70.0040.01217.14
7.2.60.0090.00316.95
7.2.50.0040.01116.94
7.2.40.0100.00316.81
7.2.30.0050.00516.88
7.2.20.0110.00316.64
7.2.10.0080.00817.02
7.2.00.0060.00718.25
7.1.250.0060.00615.81
7.1.100.0210.01717.11
7.1.70.0000.01417.20
7.1.60.0090.01519.30
7.1.50.0130.00616.75
7.1.00.0000.04022.48
7.0.200.0000.00716.77
7.0.140.0000.07722.18
7.0.120.0070.07022.09
7.0.60.0030.07321.63
7.0.50.0100.08317.85
7.0.40.0030.04720.02
7.0.30.0330.06720.25
7.0.20.0170.05320.26
7.0.10.0070.04320.06
7.0.00.0000.04720.23
5.6.280.0000.07720.93
5.6.210.0070.07020.48
5.6.200.0030.08718.16
5.6.190.0100.08720.54
5.6.180.0300.03720.63
5.6.170.0500.06020.44
5.6.160.0070.04320.70
5.6.150.0030.08318.23
5.6.140.0100.05318.28
5.6.130.0100.07318.21
5.6.120.0000.06021.01
5.6.110.0100.05721.12
5.6.100.0170.07721.01
5.6.90.0100.08020.96
5.6.80.0100.08720.54
5.5.350.0130.08320.32
5.5.340.0000.05717.96
5.5.330.0070.05020.41
5.5.320.0300.07320.30
5.5.310.0230.06720.27
5.5.300.0200.04717.96
5.5.290.0070.05318.03
5.5.280.0100.07020.84
5.5.270.0100.08720.79
5.5.260.0130.07720.96
5.5.250.0100.07720.71
5.5.240.0300.06320.37
5.4.450.0070.08019.20
5.4.440.0070.04319.18
5.4.430.0030.06719.46
5.4.420.0070.08019.30
5.4.410.0030.08019.20
5.4.400.0000.05319.27
5.4.390.0030.07718.85
5.4.380.0000.06719.24
5.4.370.0000.04319.01
5.4.360.0130.07019.11
5.4.350.0100.04019.20
5.4.340.0170.04319.26
5.4.320.0130.07019.14
5.4.310.0100.07718.98
5.4.300.0130.07019.23
5.4.290.0030.07719.15
5.4.280.0070.07319.24
5.4.270.0030.05719.14
5.4.260.0100.04319.11
5.4.250.0030.04019.14
5.4.240.0100.07719.24
5.4.230.0170.06719.11
5.4.220.0070.05719.00
5.4.210.0130.07019.15
5.4.200.0030.04319.14
5.4.190.0000.05319.23
5.4.180.0200.06718.86
5.4.170.0200.03319.23
5.4.160.0070.07318.96
5.4.150.0100.06719.09
5.4.140.0070.04016.33
5.4.130.0070.04316.34
5.4.120.0070.07316.41
5.4.110.0130.06716.49
5.4.100.0030.06316.45
5.4.90.0030.04016.41
5.4.80.0000.07716.46
5.4.70.0030.07716.35
5.4.60.0030.07316.45
5.4.50.0070.03316.40
5.4.40.0070.04016.38
5.4.30.0000.03716.26
5.4.20.0030.03716.64
5.4.10.0000.03716.27
5.4.00.0030.03715.73
5.3.290.0070.08014.82
5.3.280.0130.05314.66
5.3.270.0100.05714.62
5.3.260.0070.08014.60
5.3.250.0030.05714.77
5.3.240.0000.07714.66
5.3.230.0070.07314.66
5.3.220.0100.06014.60
5.3.210.0170.07014.54
5.3.200.0000.08014.48
5.3.190.0130.03714.60
5.3.180.0030.07714.49
5.3.170.0000.07014.55
5.3.160.0130.06314.61
5.3.150.0130.03714.60
5.3.140.0000.04014.59
5.3.130.0030.03714.58
5.3.120.0070.03314.57
5.3.110.0030.03714.55
5.3.100.0030.04014.02
5.3.90.0000.03714.05
5.3.80.0030.03714.02
5.3.70.0030.03313.94
5.3.60.0030.03714.05
5.3.50.0030.03713.99
5.3.40.0000.03713.92
5.3.30.0030.03313.98
5.3.20.0070.03313.77
5.3.10.0070.03013.61
5.3.00.0130.03013.53
5.2.170.0070.02711.08
5.2.160.0030.02711.09
5.2.150.0000.03011.04
5.2.140.0070.03311.13
5.2.130.0030.02711.25
5.2.120.0070.02711.05
5.2.110.0000.03011.05
5.2.100.0000.03010.94
5.2.90.0000.03011.00
5.2.80.0070.02711.08
5.2.70.0000.03011.02
5.2.60.0030.03010.89
5.2.50.0000.03011.02
5.2.40.0030.02710.93
5.2.30.0000.03010.79
5.2.20.0070.02310.89
5.2.10.0030.03010.89
5.2.00.0030.02710.73
5.1.60.0000.02310.14
5.1.50.0000.0279.94
5.1.40.0000.02310.00
5.1.30.0000.03010.39
5.1.20.0000.02710.25
5.1.10.0000.02710.09
5.1.00.0070.02010.06
5.0.50.0000.0208.59
5.0.40.0030.0278.48
5.0.30.0000.0308.21
5.0.20.0000.0208.22
5.0.10.0030.0178.23
5.0.00.0000.0308.14
4.4.90.0000.0177.71
4.4.80.0000.0137.71
4.4.70.0030.0137.71
4.4.60.0030.0137.71
4.4.50.0030.0137.71
4.4.40.0000.0277.71
4.4.30.0030.0137.71
4.4.20.0000.0177.71
4.4.10.0100.0077.71
4.4.00.0030.0207.71
4.3.110.0030.0137.71
4.3.100.0030.0177.71
4.3.90.0030.0137.71
4.3.80.0000.0237.71
4.3.70.0000.0177.71
4.3.60.0000.0177.71
4.3.50.0000.0137.71
4.3.40.0000.0277.71
4.3.30.0000.0177.71
4.3.20.0030.0137.71
4.3.10.0000.0177.71
4.3.00.0000.0177.71

preferences:
68.02 ms | 401 KiB | 5 Q