3v4l.org

run code in 300+ PHP versions simultaneously
<?php $extractor = function ($str) { $str = preg_replace('/\s*(?:\[at]|@)\s*/', '@', $str); $str = preg_replace('/\s*\(dot\)\s*/', '.', $str); $regexp = '/\b[a-z0-9_.-]+@(?:[a-z0-9-]+\.)+[a-z0-9]{2,4}\b/i'; preg_match_all($regexp, $str, $m); return isset($m[0]) ? $m[0] : []; }; $test_string = 'This is a test string... test1@example.org Test different formats: test2@example.org; <a href="test3@example.org">foobar</a> <test4@example.org> strange formats: test5@example.org test6[at]example.org test7@example.net.org.com test8@ example.org test9@!foo!.org test10.abc [at] hello (dot) com foobar '; print_r( $extractor($test_string) );

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.10.0110.00918.65
8.5.00.0140.00819.86
8.4.160.0180.00923.88
8.4.150.0070.00516.93
8.4.140.0130.00817.90
8.4.130.0130.00819.57
8.4.120.0160.00522.34
8.4.110.0060.00622.45
8.4.100.0120.00820.51
8.4.90.0120.00818.86
8.4.80.0050.00320.63
8.4.70.0100.00918.11
8.4.60.0110.00818.99
8.4.50.0130.00918.70
8.4.40.0100.00617.69
8.4.30.0110.00818.43
8.4.20.0070.01319.85
8.4.10.0060.00320.52
8.3.280.0020.00014.05
8.3.270.0110.00916.78
8.3.260.0120.00916.89
8.3.250.0120.00717.09
8.3.240.0110.00816.67
8.3.230.0120.00719.18
8.3.220.0080.00819.09
8.3.210.0110.00616.75
8.3.200.0040.00516.91
8.3.190.0090.00717.22
8.3.180.0070.00817.07
8.3.170.0070.01120.64
8.3.160.0120.00817.11
8.3.150.0060.01017.20
8.3.140.0080.00016.79
8.3.130.0080.00416.63
8.3.120.0040.00420.75
8.3.110.0080.00020.94
8.3.100.0040.00418.48
8.3.90.0040.00426.77
8.3.80.0070.00316.38
8.3.70.0040.01217.00
8.3.60.0090.00618.33
8.3.50.0070.01223.72
8.3.40.0140.00721.86
8.3.30.0070.00718.79
8.3.20.0070.00024.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.290.0090.01020.50
8.2.280.0040.00518.45
8.2.270.0100.01017.29
8.2.260.0040.00416.67
8.2.250.0080.00017.06
8.2.240.0100.00717.41
8.2.230.0080.00822.58
8.2.220.0060.00324.06
8.2.210.0000.00926.77
8.2.200.0060.00318.79
8.2.190.0120.00317.13
8.2.180.0120.00325.92
8.2.170.0120.00919.03
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00026.35
8.2.110.0060.00320.38
8.2.100.0070.00718.12
8.2.90.0000.00918.09
8.2.80.0030.00619.95
8.2.70.0090.00017.88
8.2.60.0040.00417.75
8.2.50.0040.00417.88
8.2.40.0000.00819.91
8.2.30.0040.00419.42
8.2.20.0050.00518.23
8.2.10.0040.00419.54
8.2.00.0000.00719.49
8.1.330.0140.00421.86
8.1.320.0130.00916.23
8.1.310.0040.01418.46
8.1.300.0160.00018.69
8.1.290.0060.00330.84
8.1.280.0150.00625.92
8.1.270.0050.00223.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00622.04
8.1.230.0040.00722.12
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0050.00317.35
8.1.190.0040.00417.47
8.1.180.0030.00618.10
8.1.170.0000.00817.62
8.1.160.0000.00719.04
8.1.150.0090.00318.95
8.1.140.0070.00018.95
8.1.130.0000.00720.10
8.1.120.0030.00517.63
8.1.110.0030.00617.55
8.1.100.0000.00717.59
8.1.90.0060.00317.52
8.1.80.0000.01017.54
8.1.70.0070.00017.61
8.1.60.0040.00417.65
8.1.50.0040.00417.66
8.1.40.0000.01017.75
8.1.30.0080.00017.78
8.1.20.0000.00817.82
8.1.10.0040.00417.77
8.1.00.0050.00317.54
8.0.300.0050.00220.02
8.0.290.0000.00717.00
8.0.280.0000.00718.44
8.0.270.0030.00317.00
8.0.260.0000.00618.39
8.0.250.0040.00417.05
8.0.240.0000.00817.00
8.0.230.0000.00717.04
8.0.220.0000.00817.03
8.0.210.0000.00717.01
8.0.200.0060.00017.00
8.0.190.0040.00417.04
8.0.180.0030.00316.99
8.0.170.0060.00316.92
8.0.160.0050.00217.01
8.0.150.0030.00617.06
8.0.140.0090.00017.04
8.0.130.0000.00613.47
8.0.120.0000.00717.04
8.0.110.0000.00716.86
8.0.100.0000.00717.09
8.0.90.0040.00416.88
8.0.80.0050.01317.06
8.0.70.0030.00517.12
8.0.60.0050.00317.05
8.0.50.0030.00517.11
8.0.30.0060.01217.46
8.0.20.0050.01417.10
8.0.10.0050.00317.21
8.0.00.0110.00917.17
7.4.330.0050.00015.55
7.4.320.0020.00516.78
7.4.300.0040.00416.80
7.4.290.0080.00016.70
7.4.280.0030.00516.79
7.4.270.0030.00416.75
7.4.260.0030.00313.53
7.4.250.0040.00416.73
7.4.240.0040.00416.64
7.4.230.0060.00016.63
7.4.220.0020.00516.75
7.4.210.0110.00716.73
7.4.200.0000.00716.73
7.4.130.0100.01116.57
7.4.120.0120.00816.70
7.4.110.0150.00316.75
7.4.100.0120.00616.59
7.4.90.0130.00616.87
7.4.80.0100.01016.50
7.4.70.0110.00716.82
7.4.60.0100.01016.61
7.4.50.0060.01716.65
7.4.40.0150.00316.79
7.4.30.0150.00316.59
7.4.20.0140.00416.47
7.4.10.0060.01216.59
7.4.00.0150.00416.47
7.3.330.0000.00716.48
7.3.320.0000.00513.55
7.3.310.0050.00216.55
7.3.300.0020.00516.46
7.3.290.0080.00716.47
7.3.260.0140.00316.84
7.3.230.0070.01116.38
7.3.220.0060.01216.54
7.3.210.0170.00316.82
7.3.200.0160.00316.64
7.3.190.0130.01016.65
7.3.180.0100.01416.81
7.3.170.0110.01116.61
7.3.160.0140.01116.79
7.3.150.0030.01516.57
7.3.140.0040.01316.48
7.3.130.0160.00316.36
7.3.120.0060.01016.52
7.3.110.0060.01216.43
7.3.100.0060.01216.54
7.3.90.0060.01316.53
7.3.80.0070.01116.78
7.3.70.0100.00616.48
7.3.60.0040.01716.48
7.3.50.0150.00516.61
7.3.40.0070.01016.49
7.3.30.0050.01316.55
7.3.20.0080.01116.38
7.3.10.0140.01116.74
7.3.00.0160.00316.57
7.2.340.0090.01116.79
7.2.330.0080.01316.73
7.2.320.0050.01016.64
7.2.310.0040.01516.78
7.2.300.0110.01117.04
7.2.290.0000.02016.80
7.2.280.0040.01516.85
7.2.270.0080.01216.80
7.2.260.0080.01116.58
7.2.250.0130.00416.86
7.2.240.0120.00916.96
7.2.230.0120.00616.83
7.2.220.0070.01016.96
7.2.210.0110.00616.79
7.2.200.0120.00816.70
7.2.190.0090.00916.66
7.2.180.0110.00716.80
7.2.170.0170.00016.62
7.2.160.0070.01316.71
7.2.150.0080.01316.95
7.2.140.0100.01016.73
7.2.130.0140.00816.84
7.2.120.0120.00816.65
7.2.110.0030.01516.70
7.2.100.0080.01116.95
7.2.90.0080.01016.81
7.2.80.0040.01516.57
7.2.70.0130.00616.80
7.2.60.0060.01316.61
7.2.50.0060.01316.77
7.2.40.0080.01116.74
7.2.30.0090.00916.92
7.2.20.0220.01117.08
7.2.10.0130.00816.73
7.2.00.0070.01316.88

preferences:
40.15 ms | 403 KiB | 5 Q