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+).*/', '$1', $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.5.00.0110.00922.85
8.4.150.0020.00014.05
8.4.140.0140.01017.57
8.4.130.0130.00818.11
8.4.120.0070.00420.72
8.4.110.0150.00718.81
8.4.100.0100.01017.88
8.4.90.0130.01017.75
8.4.80.0040.00518.05
8.4.70.0110.00918.14
8.4.60.0050.00318.91
8.4.50.0140.00617.81
8.4.40.0030.01718.06
8.4.30.0100.01020.59
8.4.20.0160.00417.94
8.4.10.0000.01921.72
8.3.280.0100.01018.46
8.3.270.0120.00716.55
8.3.260.0040.00516.56
8.3.250.0100.00718.73
8.3.240.0090.00516.59
8.3.230.0080.01016.41
8.3.220.0110.00717.01
8.3.210.0110.00516.84
8.3.200.0100.00616.50
8.3.190.0040.00418.78
8.3.180.0120.00616.57
8.3.170.0030.00716.46
8.3.160.0150.00316.77
8.3.150.0110.00717.06
8.3.140.0000.00817.06
8.3.130.0060.00616.65
8.3.120.0030.00620.63
8.3.110.0170.00616.50
8.3.100.0190.00516.52
8.3.90.0170.00321.61
8.3.80.0080.01316.49
8.3.70.0160.00816.55
8.3.60.0170.00616.51
8.3.50.0110.01518.11
8.3.40.0190.00718.69
8.3.30.0180.00718.10
8.3.20.0160.00420.84
8.3.10.0200.00621.10
8.3.00.0120.00621.74
8.2.290.0070.01020.48
8.2.280.0090.00218.42
8.2.270.0120.00616.89
8.2.260.0100.00719.21
8.2.250.0030.00518.48
8.2.240.0060.00317.46
8.2.230.0120.00618.67
8.2.220.0120.00320.21
8.2.210.0100.00421.62
8.2.200.0110.00717.37
8.2.190.0140.00516.68
8.2.180.0120.00821.27
8.2.170.0120.00518.26
8.2.160.0140.00520.25
8.2.150.0110.00321.62
8.2.140.0060.00921.09
8.2.130.0100.00321.87
8.2.120.0070.00621.82
8.2.110.0140.00319.35
8.2.100.0170.00717.69
8.2.90.0220.00418.85
8.2.80.0140.00919.03
8.2.70.0160.00517.71
8.2.60.0150.00917.62
8.2.50.0210.00417.83
8.2.40.0180.00217.89
8.2.30.0080.01217.65
8.2.20.0160.00619.07
8.2.10.0140.00418.15
8.2.00.0150.00518.55
8.1.330.0040.01216.97
8.1.320.0110.00816.17
8.1.310.0030.00517.00
8.1.300.0060.00317.94
8.1.290.0240.00223.44
8.1.280.0140.01421.14
8.1.270.0220.00620.59
8.1.260.0110.00621.88
8.1.250.0250.00422.75
8.1.240.0150.00719.79
8.1.230.0150.00719.13
8.1.220.0140.01117.51
8.1.210.0190.00717.94
8.1.200.0150.00817.32
8.1.190.0100.00517.14
8.1.180.0070.00717.62
8.1.170.0100.00417.50
8.1.160.0090.00618.05
8.1.150.0100.00417.96
8.1.140.0080.00217.81
8.1.130.0090.00517.83
8.1.120.0110.00417.87
8.1.110.0090.00517.77
8.1.100.0090.00617.74
8.1.90.0170.00317.77
8.1.80.0110.00717.81
8.1.70.0110.00517.84
8.1.60.0160.00317.87
8.1.50.0140.00517.86
8.1.40.0150.00417.90
8.1.30.0150.00418.00
8.1.20.0150.00318.01
8.1.10.0140.00517.85
8.1.00.0180.00317.69
8.0.300.0040.00918.31
8.0.290.0080.00516.51
8.0.280.0120.00217.42
8.0.270.0090.00917.16
8.0.260.0120.00417.06
8.0.250.0080.00617.21
8.0.240.0100.00517.31
8.0.230.0100.00517.27
8.0.220.0110.00417.22
8.0.210.0110.00617.09
8.0.200.0110.00617.23
8.0.190.0090.00917.10
8.0.180.0130.00417.11
8.0.170.0100.00517.14
8.0.160.0090.00517.13
8.0.150.0130.00417.06
8.0.140.0120.00317.08
8.0.130.0110.00517.05
8.0.120.0130.00317.04
8.0.110.0130.00517.14
8.0.100.0120.00417.11
8.0.90.0130.00317.15
8.0.80.0110.00617.22
8.0.70.0160.00117.20
8.0.60.0100.00617.17
8.0.50.0160.00217.04
8.0.30.0150.00417.11
8.0.20.0140.00317.17
8.0.10.0130.00317.27
7.4.330.0100.00316.13
7.4.320.0090.00616.84
7.4.300.0150.00216.93
7.4.290.0130.00516.94
7.4.280.0090.00916.81
7.4.270.0170.00116.82
7.4.260.0140.00516.91
7.4.250.0160.00216.98
7.4.240.0150.00016.86
7.4.230.0120.00316.87
7.4.220.0070.00916.86
7.4.210.0090.00516.94
7.4.200.0100.00416.95
7.4.190.0120.00416.98
7.4.180.0160.00216.94
7.4.160.0120.00516.93
7.4.150.0140.00316.87
7.4.140.0120.00516.93
7.4.130.0110.00416.76
7.4.120.0110.00416.78
7.4.110.0130.00316.92
7.4.100.0120.00317.03
7.4.90.0080.00916.91
7.4.80.0140.00616.76
7.4.70.0150.00416.81
7.4.60.0130.00516.73
7.4.50.0140.00616.83
7.4.40.0160.00616.79
7.4.30.0150.00616.80
7.4.20.0150.00616.72
7.4.10.0160.00616.70
7.4.00.0170.00416.84

preferences:
86.84 ms | 403 KiB | 5 Q