3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Fasd-id"; $sub=substr($string, strrpos($string, "-")+1, strlen($string) - strrpos($string, "-")); if (is_numeric($sub)) { $newString = substr($string, 0, strlen($string) - strlen($sub)) . " - " . (int)$sub+1; } else { $newString = $string . "-1"; } echo $newString;

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.60.0110.00716.50
8.3.50.0090.00921.03
8.3.40.0140.00718.71
8.3.30.0070.00718.71
8.3.20.0050.00220.21
8.3.10.0030.00623.53
8.3.00.0040.01123.53
8.2.180.0070.01018.16
8.2.170.0040.01422.96
8.2.160.0170.00320.43
8.2.150.0060.00324.18
8.2.140.0070.00724.66
8.2.130.0050.00319.26
8.2.120.0000.00826.35
8.2.110.0030.00620.97
8.2.100.0090.00317.91
8.2.90.0080.00019.17
8.2.80.0040.00417.97
8.2.70.0080.00417.50
8.2.60.0050.00318.03
8.2.50.0030.00618.07
8.2.40.0000.00822.18
8.2.30.0030.00720.57
8.2.20.0040.00417.63
8.2.10.0040.00418.01
8.2.00.0050.00218.13
8.1.280.0030.01225.92
8.1.270.0140.00320.30
8.1.260.0090.00928.09
8.1.250.0050.00328.09
8.1.240.0090.00021.39
8.1.230.0120.00017.45
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.13
8.1.190.0040.00417.25
8.1.180.0030.00518.10
8.1.170.0050.00318.50
8.1.160.0000.00720.73
8.1.150.0040.00418.75
8.1.140.0080.00019.45
8.1.130.0000.00717.65
8.1.120.0000.00717.41
8.1.110.0040.00417.37
8.1.100.0000.00717.30
8.1.90.0040.00417.43
8.1.80.0000.00917.39
8.1.70.0040.00417.27
8.1.60.0000.00717.55
8.1.50.0060.00317.50
8.1.40.0060.00317.44
8.1.30.0060.00317.60
8.1.20.0030.00517.66
8.1.10.0000.00717.39
8.1.00.0030.00617.42
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0070.00018.50
8.0.270.0030.00317.27
8.0.260.0060.00017.27
8.0.250.0070.00016.98
8.0.240.0070.00016.86
8.0.230.0070.00016.84
8.0.220.0070.00016.82
8.0.210.0030.00316.83
8.0.200.0000.00716.89
8.0.190.0080.00016.85
8.0.180.0080.00016.77
8.0.170.0040.00416.93
8.0.160.0080.00016.98
8.0.150.0040.00416.90
8.0.140.0000.00716.82
8.0.130.0000.00613.33
8.0.120.0030.00516.82
8.0.110.0040.00416.96
8.0.100.0070.00016.90
8.0.90.0000.00716.89
8.0.80.0030.01216.83
8.0.70.0040.00416.88
8.0.60.0050.00316.95
8.0.50.0030.00516.87
8.0.30.0090.00917.09
8.0.20.0100.00917.40
8.0.10.0000.00817.03
8.0.00.0150.00416.79
7.4.330.0020.00216.83
7.4.320.0030.00316.44
7.4.300.0000.00616.46
7.4.290.0000.00816.35
7.4.280.0000.00716.45
7.4.270.0030.00316.46
7.4.260.0030.00316.53
7.4.250.0000.00716.46
7.4.240.0040.00416.55
7.4.230.0040.00416.62
7.4.220.0140.00916.58
7.4.210.0070.01316.40
7.4.200.0040.00416.58
7.4.160.0140.00316.52
7.4.150.0070.01017.40
7.4.140.0150.00617.86
7.4.130.0080.01016.48
7.4.120.0090.00916.44
7.4.110.0100.00716.62
7.4.100.0060.01316.25
7.4.90.0170.00716.44
7.4.80.0130.00319.39
7.4.70.0150.00416.41
7.4.60.0100.00616.37
7.4.50.0030.00716.79
7.4.40.0110.00616.63
7.4.30.0060.01516.58
7.4.00.0060.00615.11
7.3.330.0000.00513.12
7.3.320.0050.00013.22
7.3.310.0040.00416.30
7.3.300.0030.00316.30
7.3.290.0110.00716.33
7.3.280.0080.01016.35
7.3.270.0100.00717.40
7.3.260.0110.00616.23
7.3.250.0050.01316.46
7.3.240.0070.01016.45
7.3.230.0070.01016.42
7.3.210.0100.00716.44
7.3.200.0150.00416.54
7.3.190.0130.01016.52
7.3.180.0030.01316.29
7.3.170.0090.00916.48
7.3.160.0030.01316.52
7.2.330.0030.01416.41
7.2.320.0090.00616.34
7.2.310.0090.00916.56
7.2.300.0060.01116.71
7.2.290.0120.01216.78
7.2.00.0000.01219.18
7.1.100.0040.00718.06
7.1.70.0060.00917.24
7.1.60.0130.01319.52
7.1.50.0100.01016.96
7.1.00.0030.07722.31
7.0.200.0000.00716.75
7.0.60.0030.09019.91
7.0.50.0000.04317.80
7.0.40.0100.08720.27
7.0.30.0270.08320.30
7.0.20.0200.06020.22
7.0.10.0130.08020.00
7.0.00.0070.04020.20
5.6.280.0000.06021.09
5.6.210.0100.05720.66
5.6.200.0030.04318.23
5.6.190.0030.04720.77
5.6.180.0300.06020.45
5.6.170.0300.07320.62
5.6.160.0070.07020.41
5.6.150.0030.05018.12
5.6.140.0030.06718.21
5.6.130.0270.07018.21
5.6.120.0100.08020.96
5.6.110.0030.04020.95
5.6.100.0130.08021.01
5.6.90.0030.09020.99
5.6.80.0130.07720.41
5.5.350.0230.04320.32
5.5.340.0130.07318.00
5.5.330.0030.04020.40
5.5.320.0370.07720.18
5.5.310.0500.03720.20
5.5.300.0100.07317.92
5.5.290.0100.08018.01
5.5.280.0100.08020.89
5.5.270.0030.06720.79
5.5.260.0000.04320.76
5.5.250.0070.04020.49
5.5.240.0200.03020.26

preferences:
56.07 ms | 401 KiB | 5 Q