3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "21-114512", "test12345abcd", "12test123456testing", "123456", "1234", "12345a67890" ]; function extract_numbers($string) { return preg_match_all('/(?<!\d)\d{5,6}(?!\d)/', $string, $match) ? $match[0] : []; } foreach ($strings as $string) { var_export(extract_numbers($string)); echo "\n---\n"; }

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.0080.00818.29
8.3.60.0030.01218.18
8.3.50.0090.00616.80
8.3.40.0060.00918.96
8.3.30.0210.00018.76
8.3.20.0070.00021.73
8.3.10.0000.00820.73
8.3.00.0000.00819.38
8.2.190.0110.00718.79
8.2.180.0120.00325.92
8.2.170.0110.01119.07
8.2.160.0070.00722.96
8.2.150.0060.00325.66
8.2.140.0110.00724.66
8.2.130.0060.00326.16
8.2.120.0090.00619.61
8.2.110.0070.00320.98
8.2.100.0040.00817.78
8.2.90.0030.00619.46
8.2.80.0000.00818.00
8.2.70.0050.00317.88
8.2.60.0000.00817.75
8.2.50.0030.00618.10
8.2.40.0040.00419.53
8.2.30.0020.00519.25
8.2.20.0000.00818.21
8.2.10.0020.00818.63
8.2.00.0060.00617.88
8.1.280.0100.01025.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0100.00023.83
8.1.230.0060.00620.80
8.1.220.0040.00417.79
8.1.210.0040.00419.09
8.1.200.0060.00317.35
8.1.190.0030.00617.38
8.1.180.0050.00318.10
8.1.170.0030.00618.59
8.1.160.0040.00418.96
8.1.150.0020.00518.92
8.1.140.0120.00018.22
8.1.130.0110.00218.97
8.1.120.0080.00317.60
8.1.110.0100.00317.68
8.1.100.0110.00217.57
8.1.90.0070.00417.60
8.1.80.0080.00517.55
8.1.70.0060.00617.67
8.1.60.0090.00417.71
8.1.50.0100.00317.68
8.1.40.0090.00617.69
8.1.30.0080.00617.69
8.1.20.0080.00617.84
8.1.10.0060.00717.72
8.1.00.0050.00617.63
8.0.300.0040.00420.03
8.0.290.0070.00316.75
8.0.280.0070.00018.54
8.0.270.0130.00316.88
8.0.260.0090.00217.67
8.0.250.0080.00317.06
8.0.240.0070.00416.96
8.0.230.0050.00617.06
8.0.220.0070.00516.95
8.0.210.0040.00516.90
8.0.200.0030.00617.93
8.0.190.0020.00617.90
8.0.180.0070.00217.93
8.0.170.0030.00717.90
8.0.160.0040.00417.87
8.0.150.0020.00617.88
8.0.140.0060.00517.84
8.0.130.0030.00416.10
8.0.120.0050.00317.86
8.0.110.0060.00317.76
8.0.100.0060.00217.82
8.0.90.0030.00617.81
8.0.80.0040.01217.88
8.0.70.0060.00417.04
8.0.60.0050.00616.82
8.0.50.0060.00517.00
8.0.30.0110.00517.16
8.0.20.0110.00617.11
8.0.10.0040.00616.99
8.0.00.0120.00916.88
7.4.330.0060.00515.92
7.4.320.0080.00416.70
7.4.300.0080.00416.63
7.4.290.0100.00316.71
7.4.280.0100.00216.73
7.4.270.0110.00216.72
7.4.260.0080.00716.70
7.4.250.0120.00116.75
7.4.240.0100.00316.73
7.4.230.0100.00216.74
7.4.220.0090.00316.63
7.4.210.0110.00616.77
7.4.200.0110.00016.69
7.4.190.0170.00216.79
7.4.180.0080.00816.73
7.4.160.0080.00916.71
7.4.150.0080.00816.63
7.4.140.0090.00817.45
7.4.130.0100.00916.77
7.4.120.0140.00516.71
7.4.110.0130.00316.67
7.4.100.0130.00616.65
7.4.90.0100.00616.64
7.4.80.0110.00617.96
7.4.70.0160.00316.73
7.4.60.0110.00516.64
7.4.50.0100.00616.58
7.4.40.0070.00916.56
7.4.30.0120.00516.55
7.4.20.0140.00016.66
7.4.10.0140.00016.63
7.4.00.0050.00915.84
7.3.330.0050.00514.92
7.3.320.0080.00314.92
7.3.310.0110.00016.37
7.3.300.0070.00416.45
7.3.290.0070.00516.40
7.3.280.0070.00816.41
7.3.270.0070.01016.30
7.3.260.0120.00616.57
7.3.250.0110.00416.30
7.3.240.0090.01016.56
7.3.230.0110.00816.50
7.3.220.0080.00816.47
7.3.210.0080.00716.41
7.3.200.0080.00816.38
7.3.190.0080.01216.58
7.3.180.0070.00816.46
7.3.170.0100.00816.40
7.3.160.0110.00416.48
7.3.150.0120.00216.35
7.3.140.0100.00716.39
7.3.130.0170.00016.41
7.3.120.0110.00416.30
7.3.110.0130.00416.39
7.3.100.0100.00716.38
7.3.90.0100.00416.56
7.3.80.0130.00316.41
7.3.70.0100.00716.48
7.3.60.0110.00416.47
7.3.50.0130.00416.48
7.3.40.0040.01216.64
7.3.30.0120.00416.61
7.3.20.0110.01017.63
7.3.10.0130.00217.53
7.3.00.0060.00917.55
7.2.340.0150.00016.69
7.2.330.0130.00316.80
7.2.320.0140.00416.79
7.2.310.0110.00516.78
7.2.300.0130.00516.85
7.2.290.0090.00616.63
7.2.280.0100.00516.55
7.2.270.0120.00416.66
7.2.260.0110.00416.76
7.2.250.0070.01116.54
7.2.240.0080.00716.62
7.2.230.0090.00916.55
7.2.220.0110.00416.71
7.2.210.0130.00316.66
7.2.200.0180.00016.63
7.2.190.0110.00516.68
7.2.180.0130.00416.89
7.2.170.0080.00816.89
7.2.160.0070.00716.65
7.2.150.0100.00317.81
7.2.140.0090.00617.82
7.2.130.0120.00617.82
7.2.120.0060.00817.79
7.2.110.0090.00417.85
7.2.100.0060.00817.74
7.2.90.0130.00117.82
7.2.80.0150.00517.93
7.2.70.0100.00617.82
7.2.60.0120.00317.96
7.2.50.0100.00417.88
7.2.40.0120.00317.98
7.2.30.0090.00517.88
7.2.20.0170.00317.86
7.2.10.0080.00817.80
7.2.00.0070.01217.92
7.1.330.0140.00017.48
7.1.320.0140.00317.50
7.1.310.0120.00417.33
7.1.300.0140.00017.41
7.1.290.0110.00417.40
7.1.280.0120.00317.29
7.1.270.0120.00217.43
7.1.260.0100.00417.27
7.1.250.0130.00416.73
7.1.240.0000.01617.30
7.1.230.0130.00317.41
7.1.220.0080.00717.28
7.1.210.0100.00517.29
7.1.200.0120.00417.27
7.1.190.0110.00317.24
7.1.180.0110.00617.35
7.1.170.0050.00917.34
7.1.160.0090.00917.31
7.1.150.0110.00417.21
7.1.140.0050.01017.24
7.1.130.0120.00517.42
7.1.120.0090.00717.29
7.1.110.0050.01017.44
7.1.100.0100.00517.47
7.1.90.0140.00017.58
7.1.80.0110.00317.52
7.1.70.0130.00317.42
7.1.60.0140.00317.59
7.1.50.0100.00517.52
7.1.40.0120.00417.41
7.1.30.0110.00317.61
7.1.20.0150.00017.51
7.1.10.0110.00317.45
7.1.00.0070.01017.50

preferences:
18.33 ms | 401 KiB | 5 Q