3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = [ "Mr. Kiefer William Frederick Dempsey George Rufus Sutherland Sr.", "Carolina Maria de Jesus", "Kiefer William Frederick Dempsey George Rufus Sutherland Jr.", "Mrs. Carolina Maria de Jesus"]; foreach($names as $name) { preg_match('/(?:\w+\. )?(\w+).*?(\w+)(?: \w+\.)?$/', $name, $result); echo $result[1] . ' ' . $result[2] . ' = ' . $result[1][0].$result[2][0] . PHP_EOL; }

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.10.0060.00319.71
8.3.140.0120.00016.66
8.3.130.0000.00816.95
8.3.120.0000.00919.16
8.3.110.0120.00416.55
8.3.100.0030.00618.36
8.3.90.0110.00426.77
8.3.80.0040.00416.50
8.3.70.0100.01018.55
8.3.60.0110.00718.19
8.3.50.0110.00724.64
8.3.40.0180.00318.77
8.3.30.0070.00718.73
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0080.00026.16
8.2.260.0040.00422.43
8.2.250.0040.01116.68
8.2.240.0120.00617.13
8.2.230.0090.00020.94
8.2.220.0130.00737.54
8.2.210.0000.00726.77
8.2.200.0090.00017.00
8.2.190.0150.00316.63
8.2.180.0090.00625.92
8.2.170.0120.00919.21
8.2.160.0030.01022.96
8.2.150.0000.00825.66
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0080.00026.35
8.2.110.0070.01022.38
8.2.100.0090.00318.03
8.2.90.0000.00819.17
8.2.80.0040.00417.97
8.2.70.0000.00917.63
8.2.60.0060.00317.93
8.2.50.0080.00018.10
8.2.40.0000.00919.60
8.2.30.0050.00318.58
8.2.20.0050.00518.03
8.2.10.0100.00218.55
8.2.00.0100.00118.60
8.1.310.0000.00816.53
8.1.300.0100.00719.81
8.1.290.0030.00630.84
8.1.280.0130.00325.92
8.1.270.0080.00823.99
8.1.260.0030.00628.09
8.1.250.0040.00428.09
8.1.240.0060.00317.48
8.1.230.0060.00617.89
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0030.00617.48
8.1.180.0040.00418.10
8.1.170.0040.00420.46
8.1.160.0080.00518.32
8.1.150.0060.00718.30
8.1.140.0060.00618.30
8.1.130.0050.00618.90
8.1.120.0060.00617.62
8.1.110.0090.00317.66
8.1.100.0090.00317.61
8.1.90.0080.00417.61
8.1.80.0070.00717.66
8.1.70.0040.00817.63
8.1.60.0110.00317.78
8.1.50.0070.00617.69
8.1.40.0100.00317.71
8.1.30.0090.00617.68
8.1.20.0080.00517.79
8.1.10.0080.00517.76
8.1.00.0060.00717.69
8.0.300.0000.00718.77
8.0.290.0040.00416.88
8.0.280.0070.00417.71
8.0.270.0100.00216.94
8.0.260.0050.00518.47
8.0.250.0050.00717.04
8.0.240.0090.00317.02
8.0.230.0100.00217.03
8.0.220.0080.00316.96
8.0.210.0070.00417.03
8.0.200.0080.00417.12
8.0.190.0080.00317.03
8.0.180.0060.00617.03
8.0.170.0070.00516.92
8.0.160.0070.00416.96
8.0.150.0050.00416.99
8.0.140.0030.00616.97
8.0.130.0020.00615.25
8.0.120.0030.00615.76
8.0.110.0030.00515.72
8.0.100.0030.00815.73
8.0.90.0060.00315.74
8.0.80.0070.00616.06
8.0.70.0040.00515.80
8.0.60.0090.00115.75
8.0.50.0050.00515.82
8.0.30.0060.00816.15
8.0.20.0120.00516.54
8.0.10.0080.00616.27
8.0.00.0070.00916.44
7.4.330.0040.00316.14
7.4.320.0070.00416.80
7.4.300.0050.00816.72
7.4.290.0100.00216.64
7.4.280.0050.00616.70
7.4.270.0080.00416.78
7.4.260.0060.00515.10
7.4.250.0040.00815.67
7.4.240.0100.00215.67
7.4.230.0090.00415.63
7.4.220.0060.00415.89
7.4.210.0090.00416.16
7.4.200.0070.00415.70
7.4.190.0090.00415.18
7.4.180.0090.00515.14
7.4.160.0070.00715.64
7.4.150.0070.00815.91
7.4.140.0110.00615.88
7.4.130.0120.00516.14
7.4.120.0110.00716.04
7.4.110.0080.00815.97
7.4.100.0080.00816.10
7.4.90.0130.00715.96
7.4.80.0070.01015.98
7.4.70.0110.00715.99
7.4.60.0120.00616.04
7.4.50.0140.00516.02
7.4.40.0100.00615.93
7.4.30.0100.00816.02
7.4.20.0100.00616.04
7.4.10.0110.00615.96
7.4.00.0120.00616.00
7.3.330.0090.00216.63
7.3.320.0100.00214.45
7.3.310.0100.00215.54
7.3.300.0030.00915.51
7.3.290.0100.00815.91
7.3.280.0090.00515.53
7.3.270.0110.00515.74
7.3.260.0110.00615.95
7.3.250.0100.00615.76
7.3.240.0100.00515.70
7.3.230.0090.00615.98
7.3.220.0080.00915.76
7.3.210.0100.01015.88
7.3.200.0090.00815.83
7.3.190.0080.00915.91
7.3.180.0080.00915.83
7.3.170.0080.00815.91
7.3.160.0080.00715.87
7.3.150.0100.00615.85
7.3.140.0120.00415.91
7.3.130.0080.00915.93
7.3.120.0110.00715.90
7.3.110.0080.00815.82
7.3.100.0140.00815.82
7.3.90.0100.00715.94
7.3.80.0070.00715.89
7.3.70.0090.00615.88
7.3.60.0110.00515.99
7.3.50.0060.00815.93
7.3.40.0060.00815.98
7.3.30.0070.00815.96
7.3.20.0100.00516.97
7.3.10.0070.00916.94
7.3.00.0100.00616.93
7.2.340.0140.00815.90
7.2.330.0130.01016.09
7.2.320.0160.00716.06
7.2.310.0160.00616.08
7.2.300.0160.01416.09
7.2.290.0120.01016.08
7.2.280.0160.00616.11
7.2.270.0140.00716.00
7.2.260.0150.00716.06
7.2.250.0180.00516.12
7.2.240.0160.00716.07
7.2.230.0150.00816.14
7.2.220.0150.00616.04
7.2.210.0110.01016.08
7.2.200.0140.00816.12
7.2.190.0140.00716.08
7.2.180.0140.00816.11
7.2.170.0130.00716.09
7.2.160.0160.00516.09
7.2.150.0150.00617.21
7.2.140.0110.01117.19
7.2.130.0150.00717.26
7.2.120.0240.00817.34
7.2.110.0150.00717.26
7.2.100.0170.00517.24
7.2.90.0150.00717.21
7.2.80.0170.00517.25
7.2.70.0130.00817.26
7.2.60.0180.00717.26
7.2.50.0150.01117.24
7.2.40.0150.00617.30
7.2.30.0220.00717.19
7.2.20.0130.00917.27
7.2.10.0130.00917.25
7.2.00.0120.00917.24

preferences:
27.84 ms | 403 KiB | 5 Q