3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = "Example-001"; $parts = explode("-",$str1); echo $parts[0] . "-" . str_pad($parts[1] + 1, 3, 0, STR_PAD_LEFT);

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.40.0150.00718.84
8.3.30.0140.00020.34
8.3.20.0040.00420.16
8.3.10.0040.00421.95
8.3.00.0050.00222.37
8.2.170.0060.00822.96
8.2.160.0110.00722.31
8.2.150.0030.00624.18
8.2.140.0040.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00420.80
8.2.110.0070.00322.25
8.2.100.0040.00817.84
8.2.90.0080.00018.00
8.2.80.0040.00418.05
8.2.70.0060.00318.04
8.2.60.0000.00818.04
8.2.50.0040.00418.10
8.2.40.0000.00820.27
8.2.30.0030.00519.31
8.2.20.0000.00717.74
8.2.10.0050.00317.65
8.2.00.0070.00417.79
8.1.270.0030.00623.99
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0040.00422.23
8.1.230.0040.00719.11
8.1.220.0060.00317.79
8.1.210.0000.00818.77
8.1.200.0000.00917.35
8.1.190.0000.00817.11
8.1.180.0060.00318.10
8.1.170.0000.00718.50
8.1.160.0070.00018.82
8.1.150.0040.00418.64
8.1.140.0000.00717.49
8.1.130.0030.00317.88
8.1.120.0040.00417.36
8.1.110.0090.00017.36
8.1.100.0030.00417.45
8.1.90.0040.00417.45
8.1.80.0070.00017.48
8.1.70.0070.00017.48
8.1.60.0030.00517.52
8.1.50.0000.00717.38
8.1.40.0030.00517.40
8.1.30.0040.00417.52
8.1.20.0050.00317.71
8.1.10.0040.00417.43
8.1.00.0040.00417.55
8.0.300.0070.00019.83
8.0.290.0050.00316.75
8.0.280.0040.00418.47
8.0.270.0040.00417.26
8.0.260.0030.00316.93
8.0.250.0030.00316.91
8.0.240.0040.00416.89
8.0.230.0040.00317.01
8.0.220.0030.00316.86
8.0.210.0050.00316.91
8.0.200.0000.00716.91
8.0.190.0070.00017.02
8.0.180.0040.00416.91
8.0.170.0040.00417.00
8.0.160.0030.00316.89
8.0.150.0000.00716.86
8.0.140.0050.00316.97
8.0.130.0000.00613.28
8.0.120.0000.00716.83
8.0.110.0050.00316.84
8.0.100.0000.00716.82
8.0.90.0000.00716.98
8.0.80.0080.00816.91
8.0.70.0000.00716.95
8.0.60.0030.00617.00
8.0.50.0000.00716.99
8.0.30.0110.01016.97
8.0.20.0090.00917.40
8.0.10.0030.00617.05
8.0.00.0060.01116.80
7.4.330.0060.00015.00
7.4.320.0030.00316.63
7.4.300.0030.00316.55
7.4.290.0070.00016.53
7.4.280.0040.00416.59
7.4.270.0100.00016.52
7.4.260.0000.00513.27
7.4.250.0040.00416.37
7.4.240.0040.00416.50
7.4.230.0070.00016.57
7.4.220.0070.01416.40
7.4.210.0070.00816.54
7.4.200.0000.00716.56
7.4.190.0040.00416.50
7.4.160.0130.00716.35
7.4.150.0110.00617.40
7.4.140.0070.01017.86
7.4.130.0080.01116.50
7.4.120.0090.00716.46
7.4.110.0070.01416.41
7.4.100.0070.01116.48
7.4.90.0120.00416.34
7.4.80.0110.01219.39
7.4.70.0110.00816.32
7.4.60.0070.01116.50
7.4.50.0040.00416.61
7.4.40.0040.01122.77
7.4.30.0040.01716.47
7.4.00.0070.01014.84
7.3.330.0020.00213.20
7.3.320.0000.00613.17
7.3.310.0070.00016.33
7.3.300.0030.00316.28
7.3.290.0070.00716.20
7.3.280.0060.00916.21
7.3.270.0070.01017.40
7.3.260.0090.01616.36
7.3.250.0130.00416.35
7.3.240.0060.01016.41
7.3.230.0130.00316.39
7.3.210.0120.00616.24
7.3.200.0140.01119.39
7.3.190.0090.01316.44
7.3.180.0120.00416.27
7.3.170.0100.00716.28
7.3.160.0130.00916.51
7.3.120.0090.00614.62
7.2.330.0070.01516.70
7.2.320.0120.00916.34
7.2.310.0160.00616.58
7.2.300.0000.01616.30
7.2.290.0080.00816.79
7.2.00.0030.00919.36
7.1.100.0170.00717.99
7.1.70.0040.00417.14
7.1.60.0030.02019.32
7.1.50.0090.01316.97
7.1.00.0030.05322.43
7.0.200.0030.00616.66
7.0.140.0100.07022.00
7.0.110.0200.07019.89
7.0.100.0100.07719.91
7.0.90.0030.08019.84
7.0.80.0100.08019.86
7.0.70.0100.07019.99
7.0.60.0100.08019.89
7.0.50.0030.08320.30
7.0.40.0130.06720.08
7.0.30.0100.08020.02
7.0.20.0130.04020.27
7.0.10.0070.08320.21
7.0.00.0030.08020.27
5.6.280.0000.07721.09
5.6.260.0200.07320.59
5.6.250.0230.06720.58
5.6.240.0070.07720.66
5.6.230.0130.04720.59
5.6.220.0170.07320.63
5.6.210.0200.07020.66
5.6.200.0070.08321.14
5.6.190.0070.07720.91
5.6.180.0030.07021.19
5.6.170.0230.06321.11
5.6.160.0070.08321.05
5.6.150.0070.08721.13
5.6.140.0100.08321.07
5.6.130.0070.08721.11
5.6.120.0070.08321.18
5.6.110.0070.07721.11
5.6.100.0030.08721.00
5.6.90.0070.08020.99
5.6.80.0100.07020.59
5.6.70.0130.06020.64
5.6.60.0130.07320.34
5.6.50.0100.08020.52
5.6.40.0030.08020.48
5.6.30.0100.05320.64
5.6.20.0100.04320.48
5.6.10.0070.06320.63
5.6.00.0070.05020.38
5.5.380.0000.08320.25
5.5.370.0000.09020.45
5.5.360.0100.08020.21
5.5.350.0130.08020.38
5.5.340.0100.07320.88
5.5.330.0070.04720.80
5.5.320.0130.06320.96
5.5.310.0100.07320.93
5.5.300.0130.07720.96
5.5.290.0070.08320.98
5.5.280.0070.08020.89
5.5.270.0070.07720.89
5.5.260.0170.06720.85
5.5.250.0070.08320.71
5.5.240.0130.06320.27
5.5.230.0200.07320.27
5.5.220.0030.07720.34
5.5.210.0100.07020.07
5.5.200.0100.06020.30
5.5.190.0070.08020.12
5.5.180.0070.06720.20
5.5.160.0100.04020.29
5.5.150.0100.07720.22
5.5.140.0030.08320.11
5.5.130.0130.06720.15
5.5.120.0000.08320.24
5.5.110.0100.06720.09
5.5.100.0100.03320.27
5.5.90.0000.07720.26
5.5.80.0030.07720.24
5.5.70.0030.07720.06
5.5.60.0130.07320.09
5.5.50.0030.08319.98
5.5.40.0170.07020.18
5.5.30.0170.07020.02
5.5.20.0070.07720.15
5.5.10.0070.08320.23
5.5.00.0100.08020.20
5.4.450.0130.07019.49
5.4.440.0100.06719.57
5.4.430.0130.06719.44
5.4.420.0070.07719.32
5.4.410.0130.07319.16
5.4.400.0030.07719.08
5.4.390.0000.08019.12
5.4.380.0170.07018.90
5.4.370.0000.08019.18
5.4.360.0130.06718.93
5.4.350.0070.07319.08
5.4.340.0030.07319.27
5.4.320.0100.07718.93
5.4.310.0200.06019.10
5.4.300.0030.08019.25
5.4.290.0100.07719.07
5.4.280.0000.08019.02
5.4.270.0070.07019.09
5.4.260.0130.06718.95
5.4.250.0070.07019.02
5.4.240.0070.04719.07
5.4.230.0030.07019.02
5.4.220.0100.07719.11
5.4.210.0070.07719.02
5.4.200.0000.06319.11
5.4.190.0100.06018.89
5.4.180.0070.07719.02
5.4.170.0200.06319.26
5.4.160.0030.07719.05
5.4.150.0070.08719.05
5.4.140.0030.07716.29
5.4.130.0200.05716.40
5.4.120.0070.07716.30
5.4.110.0070.07316.19
5.4.100.0070.07016.36
5.4.90.0130.06316.44
5.4.80.0070.07716.46
5.4.70.0070.07316.36
5.4.60.0070.07316.35
5.4.50.0000.05016.34
5.4.40.0000.05716.40
5.4.30.0100.07016.32
5.4.20.0030.05016.36
5.4.10.0070.07316.26
5.4.00.0030.07015.92
5.3.290.0200.05714.54
5.3.280.0030.08014.50
5.3.270.0100.06714.50
5.3.260.0070.04714.53
5.3.250.0130.07014.43
5.3.240.0100.07014.46
5.3.230.0100.07014.69
5.3.220.0070.06714.63
5.3.210.0100.07014.58
5.3.200.0100.07714.54
5.3.190.0100.07014.46
5.3.180.0030.07714.59
5.3.170.0030.05014.55
5.3.160.0070.07314.57
5.3.150.0030.07314.66
5.3.140.0000.07314.41
5.3.130.0030.08314.61
5.3.120.0030.05014.39
5.3.110.0030.06014.39
5.3.100.0030.07714.10
5.3.90.0030.07014.11
5.3.80.0200.05713.87
5.3.70.0100.06314.03
5.3.60.0170.06013.88
5.3.50.0100.05313.77
5.3.40.0000.04713.80
5.3.30.0130.06313.92
5.3.20.0100.06313.53
5.3.10.0030.07313.48
5.3.00.0070.07013.71
5.2.170.0070.05312.02
5.2.160.0030.06012.02
5.2.150.0000.06312.02
5.2.140.0000.06312.02
5.2.130.0130.05312.02
5.2.120.0030.06712.02
5.2.110.0030.06312.02
5.2.100.0070.06312.02
5.2.90.0070.05712.02
5.2.80.0030.06012.02
5.2.70.0030.06312.02
5.2.60.0030.06312.02
5.2.50.0030.06312.02
5.2.40.0000.06712.02
5.2.30.0030.05712.02
5.2.20.0030.03312.02
5.2.10.0100.04312.02
5.2.00.0030.06312.02
5.1.60.0100.04712.02
5.1.50.0030.05012.02
5.1.40.0070.04712.02
5.1.30.0070.04712.02
5.1.20.0000.06012.02
5.1.10.0070.04312.02
5.1.00.0030.05712.02
5.0.50.0000.05012.02
5.0.40.0030.02712.02
5.0.30.0070.06012.02
5.0.20.0000.03712.02
5.0.10.0000.04312.02
5.0.00.0030.06712.02
4.4.90.0000.03712.02
4.4.80.0000.02012.02
4.4.70.0000.03712.02
4.4.60.0000.04012.02
4.4.50.0070.03312.02
4.4.40.0000.05312.02
4.4.30.0070.03012.02
4.4.20.0100.02712.02
4.4.10.0000.04012.02
4.4.00.0070.05012.02
4.3.110.0030.03012.02
4.3.100.0130.02712.02
4.3.90.0100.02712.02
4.3.80.0070.05012.02
4.3.70.0000.03712.02
4.3.60.0000.03312.02
4.3.50.0100.02712.02
4.3.40.0000.05712.02
4.3.30.0030.03312.02
4.3.20.0000.03712.02
4.3.10.0000.03712.02
4.3.00.0000.03712.02

preferences:
44.23 ms | 400 KiB | 5 Q