3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ 'stage', // expect empty string '8.-10. stage', // expect 8 '8. stage', // expect 8 '8.-10. stage 1st', // expect 8 'Test 8. stage 2020', // expect 8 'Test 8.-10. stage - 2020 test', // expect 8 'A1B2C3D4D5E6F7G8', // expect 1 '1000', // expect 1000 'Test 2020', // ecpect 2020 ]; var_export( preg_replace('/^\D+|\d+\K.*/', '', $strings) );

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.4.120.0100.00920.83
8.4.110.0050.00420.79
8.4.100.0050.00417.68
8.4.90.0120.00922.54
8.4.80.0050.00319.91
8.4.70.0150.00617.97
8.4.60.0100.01018.86
8.4.50.0130.00720.20
8.4.40.0100.01019.50
8.4.30.0120.00820.17
8.4.20.0100.01017.97
8.4.10.0090.00317.72
8.3.250.0050.00318.73
8.3.240.0080.00916.68
8.3.230.0130.00616.83
8.3.220.0030.00418.98
8.3.210.0100.01016.61
8.3.200.0130.00616.59
8.3.190.0140.00717.26
8.3.180.0130.00616.34
8.3.170.0110.00717.15
8.3.160.0070.01120.39
8.3.150.0090.00916.75
8.3.140.0150.00016.61
8.3.130.0080.00016.69
8.3.120.0030.00820.76
8.3.110.0060.00316.64
8.3.100.0080.00824.06
8.3.90.0070.00726.77
8.3.80.0060.00316.63
8.3.70.0140.00016.75
8.3.60.0090.00918.41
8.3.50.0090.00723.75
8.3.40.0110.01118.98
8.3.30.0040.01118.67
8.3.20.0040.00420.63
8.3.10.0040.00420.26
8.3.00.0060.00320.82
8.2.290.0090.00922.30
8.2.280.0050.00518.49
8.2.270.0130.00716.97
8.2.260.0040.01118.39
8.2.250.0050.00316.97
8.2.240.0090.00017.01
8.2.230.0120.00420.94
8.2.220.0060.00337.54
8.2.210.0060.00326.77
8.2.200.0090.00016.88
8.2.190.0070.00716.75
8.2.180.0070.00718.66
8.2.170.0040.01122.96
8.2.160.0070.00720.53
8.2.150.0070.00324.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0030.00621.19
8.2.110.0070.00421.12
8.2.100.0080.00317.91
8.2.90.0000.00720.46
8.2.80.0000.00817.97
8.2.70.0050.00317.80
8.2.60.0080.00018.22
8.2.50.0060.00318.07
8.2.40.0040.00418.09
8.2.30.0000.00719.33
8.2.20.0040.00417.93
8.2.10.0080.00019.20
8.2.00.0070.00019.25
8.1.330.0100.00923.56
8.1.320.0130.00816.37
8.1.310.0040.00418.33
8.1.300.0130.00616.41
8.1.290.0030.00618.88
8.1.280.0110.00725.92
8.1.270.0120.00422.42
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00623.97
8.1.230.0110.00020.84
8.1.220.0000.00817.74
8.1.210.0000.00818.79
8.1.200.0060.00317.48
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0060.00318.65
8.1.160.0040.00419.03
8.1.150.0070.00018.95
8.1.140.0040.00418.85
8.1.130.0030.00320.20
8.1.120.0040.00417.48
8.1.110.0000.00717.41
8.1.100.0040.00417.52
8.1.90.0040.00417.55
8.1.80.0030.00517.52
8.1.70.0000.00717.53
8.1.60.0060.00317.62
8.1.50.0000.00817.58
8.1.40.0040.00417.60
8.1.30.0040.00417.66
8.1.20.0000.00817.63
8.1.10.0000.00817.48
8.1.00.0000.00817.51
8.0.300.0040.00419.73
8.0.290.0040.00416.88
8.0.280.0040.00418.39
8.0.270.0040.00418.14
8.0.260.0030.00319.89
8.0.250.0000.00717.01
8.0.240.0000.00717.01
8.0.230.0000.00716.96
8.0.220.0050.00217.06
8.0.210.0040.00417.05
8.0.200.0000.00717.08
8.0.190.0000.00717.07
8.0.180.0030.00617.05
8.0.170.0090.00317.05
8.0.160.0000.00717.10
8.0.150.0040.00416.89
8.0.140.0000.00717.01
8.0.130.0030.00313.50
8.0.120.0000.00717.02
8.0.110.0000.00717.02
8.0.100.0050.00216.90
8.0.90.0000.00917.00
8.0.80.0100.00717.02
8.0.70.0080.00016.89
8.0.60.0040.00416.85
8.0.50.0040.00416.89
8.0.30.0110.00717.15
8.0.20.0190.00617.10
8.0.10.0050.00217.09
8.0.00.0060.01116.86
7.4.330.0050.00015.55
7.4.320.0060.00016.66
7.4.300.0070.00016.56
7.4.290.0000.00716.55
7.4.280.0100.00016.76
7.4.270.0060.00316.65
7.4.260.0000.00513.47
7.4.250.0000.00816.59
7.4.240.0020.00516.65
7.4.230.0030.00316.77
7.4.220.0000.00716.70
7.4.210.0050.01016.69
7.4.200.0040.00416.84
7.4.130.0080.01216.73
7.4.120.0070.01116.70
7.4.110.0150.00316.47
7.4.100.0070.01116.60
7.4.90.0060.01216.55
7.4.80.0160.00719.39
7.4.70.0000.01716.42
7.4.60.0060.01616.60
7.4.50.0060.00816.47
7.4.40.0030.01316.59
7.4.20.0100.00616.36
7.4.10.0060.01016.32
7.4.00.0060.01616.58
7.3.330.0000.00716.18
7.3.320.0030.00313.19
7.3.310.0000.00716.41
7.3.300.0000.00716.32
7.3.290.0060.01016.33
7.3.260.0100.00716.64
7.3.240.0090.01016.53
7.3.230.0060.01116.28
7.3.210.0070.01016.67
7.3.200.0040.01216.47
7.3.190.0100.00716.63
7.3.180.0140.00316.59
7.3.170.0060.00916.49
7.3.160.0060.01116.27
7.3.140.0130.00316.66
7.3.130.0120.00316.49
7.3.120.0090.01216.29
7.3.110.0180.00316.25
7.3.100.0060.01016.58
7.3.90.0100.01016.23
7.3.80.0090.00916.52
7.3.70.0090.01216.40
7.3.60.0070.01316.26
7.3.50.0090.01216.51
7.3.40.0120.00816.32
7.3.30.0090.00616.29
7.3.20.0090.00616.38
7.3.10.0000.01716.39
7.3.00.0090.00616.42
7.2.330.0100.01016.59
7.2.320.0030.01316.68
7.2.310.0100.00716.56
7.2.300.0080.01716.74
7.2.290.0070.01016.37
7.2.270.0070.01016.45
7.2.260.0090.01516.66
7.2.250.0060.01616.58
7.2.240.0130.01016.52
7.2.230.0110.01016.50
7.2.220.0080.01516.71
7.2.210.0130.00316.55
7.2.200.0060.01516.54
7.2.190.0130.00316.62
7.2.180.0060.01516.50
7.2.170.0070.01416.33
7.2.160.0080.00916.45
7.2.150.0140.00316.77
7.2.140.0110.00816.64
7.2.130.0120.01216.55
7.2.120.0100.01316.64
7.2.110.0070.01016.52
7.2.100.0060.00916.55
7.2.90.0000.01816.56
7.2.80.0120.01316.69
7.2.70.0070.01016.54
7.2.60.0000.01816.68
7.2.50.0140.00316.45
7.2.40.0060.01216.64
7.2.30.0100.00716.77
7.2.20.0100.00616.30
7.2.10.0030.01416.68
7.2.00.0130.00316.47

preferences:
122.25 ms | 403 KiB | 5 Q