3v4l.org

run code in 300+ PHP versions simultaneously
<?php function splitEmail($str) { $pattern = "/([\w\s\'\"]+[\s]+)?(<)?(([\w-\.]+)@((?:[\w]+\.)+)([a-zA-Z]{2,4}))?(>)?/g"; preg_match($pattern, $str, $match); return array( 'name' => isset($match[1]) ? trim($match[1]) : null, 'email' => isset($match[3]) ? trim($match[3]) : null, ); } $e = array( '<foo@bar.com>', 'Miguel <miguel@bar.com>', '"ddd" <123@d.com>', 'll\'f <ddd@ddd.ll>', 'foo@bar.com', ); foreach($e as $v) { var_dump(splitEmail($v)); }

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.60.0080.00818.39
8.3.50.0070.00722.12
8.3.40.0100.01018.58
8.3.30.0070.01018.61
8.3.20.0080.00018.83
8.3.10.0030.00621.09
8.3.00.0080.00023.72
8.2.180.0140.00716.50
8.2.170.0140.00722.96
8.2.160.0070.00720.39
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.06
8.2.110.0060.00320.22
8.2.100.0080.00317.97
8.2.90.0040.00419.35
8.2.80.0030.00619.25
8.2.70.0050.00317.63
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0040.00418.22
8.2.30.0060.00321.35
8.2.20.0040.00417.71
8.2.10.0000.00817.68
8.2.00.0000.00817.78
8.1.280.0060.00825.92
8.1.270.0040.00423.99
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0080.00622.66
8.1.230.0110.00020.95
8.1.220.0040.00418.77
8.1.210.0000.00818.90
8.1.200.0030.00616.98
8.1.190.0050.00317.52
8.1.180.0040.00418.10
8.1.170.0030.00618.48
8.1.160.0040.00418.87
8.1.150.0000.00718.64
8.1.140.0040.00417.36
8.1.130.0030.00317.76
8.1.120.0030.00517.37
8.1.110.0040.00417.42
8.1.100.0040.00417.44
8.1.90.0000.00717.47
8.1.80.0030.00517.46
8.1.70.0040.00417.41
8.1.60.0060.00317.51
8.1.50.0030.00617.45
8.1.40.0040.00417.39
8.1.30.0000.00817.58
8.1.20.0040.00417.56
8.1.10.0070.00017.58
8.1.00.0000.01117.50
8.0.300.0040.00419.90
8.0.290.0040.00417.17
8.0.280.0070.00018.44
8.0.270.0000.00717.16
8.0.260.0030.00316.87
8.0.250.0050.00317.04
8.0.240.0040.00416.90
8.0.230.0040.00317.04
8.0.220.0070.00316.97
8.0.210.0070.00016.92
8.0.200.0030.00317.01
8.0.190.0070.00016.85
8.0.180.0040.00416.98
8.0.170.0000.00716.87
8.0.160.0030.00416.85
8.0.150.0070.00016.78
8.0.140.0070.00016.89
8.0.130.0050.00013.39
8.0.120.0060.00316.87
8.0.110.0040.00416.91
8.0.100.0050.00216.92
8.0.90.0050.00216.81
8.0.80.0060.01016.93
8.0.70.0040.00416.79
8.0.60.0030.00616.84
8.0.50.0040.00416.82
8.0.30.0100.00817.15
8.0.20.0110.01217.40
8.0.10.0040.00416.96
8.0.00.0120.00616.71
7.4.330.0060.00016.67
7.4.320.0030.00316.51
7.4.300.0030.00316.56
7.4.290.0030.00316.57
7.4.280.0000.00716.50
7.4.270.0000.00816.36
7.4.260.0000.00513.31
7.4.250.0040.00416.62
7.4.240.0070.00016.52
7.4.230.0030.00516.39
7.4.220.0110.00716.52
7.4.210.0060.01016.57
7.4.200.0000.00816.25
7.4.190.0050.00316.70
7.4.160.0100.01316.48
7.4.150.0090.00917.40
7.4.140.0120.00617.86
7.4.130.0130.00816.51
7.4.120.0110.01016.57
7.4.110.0050.01216.32
7.4.100.0120.01216.39
7.4.90.0110.00916.68
7.4.80.0100.00719.39
7.4.70.0100.00716.57
7.4.60.0070.00716.43
7.4.50.0060.00316.62
7.4.40.0030.01322.77
7.4.30.0130.00416.57
7.4.10.0070.01014.91
7.4.00.0050.01215.01
7.3.330.0030.00213.36
7.3.320.0000.00513.35
7.3.310.0000.00716.40
7.3.300.0030.00316.37
7.3.290.0090.00616.43
7.3.280.0090.00716.36
7.3.270.0040.01617.40
7.3.260.0120.00818.24
7.3.250.0100.01016.47
7.3.240.0070.01016.68
7.3.230.0130.00616.45
7.3.210.0100.01016.64
7.3.200.0110.00719.39
7.3.190.0070.01116.28
7.3.180.0090.00616.53
7.3.170.0000.01716.42
7.3.160.0030.01716.29
7.3.130.0090.00614.69
7.3.120.0030.01314.89
7.3.110.0060.01014.96
7.3.100.0040.01114.96
7.3.90.0110.00415.08
7.3.80.0060.00615.15
7.3.70.0090.00314.86
7.3.60.0100.00014.54
7.3.50.0060.00314.94
7.3.40.0040.01514.80
7.3.30.0120.00614.91
7.3.20.0100.00316.82
7.3.10.0070.00716.64
7.3.00.0090.00616.72
7.2.330.0030.01516.69
7.2.320.0150.00316.48
7.2.310.0120.00916.71
7.2.300.0070.01016.63
7.2.290.0030.01516.50
7.2.260.0070.01114.93
7.2.250.0060.01214.86
7.2.240.0000.01615.21
7.2.230.0060.01014.86
7.2.220.0030.01314.80
7.2.210.0030.01015.16
7.2.200.0040.00815.09
7.2.190.0030.01114.67
7.2.180.0070.01115.01
7.2.170.0030.01015.19
7.2.160.0060.00915.02
7.2.150.0040.01116.71
7.2.140.0030.01017.00
7.2.130.0030.01316.80
7.2.120.0070.00316.82
7.2.110.0000.01516.84
7.2.100.0030.00716.98
7.2.90.0130.00316.93
7.2.80.0030.01216.94
7.2.70.0070.00717.03
7.2.60.0030.01016.94
7.2.50.0040.00816.95
7.2.40.0070.01016.99
7.2.30.0090.00616.88
7.2.20.0000.01116.71
7.2.10.0030.01017.01
7.2.00.0060.00916.72
7.1.330.0050.00415.87
7.1.320.0060.00915.91
7.1.310.0060.00615.48
7.1.300.0070.00715.37
7.1.290.0040.01515.75
7.1.280.0120.00315.77
7.1.270.0000.01416.00
7.1.260.0000.00815.80
7.1.250.0040.01115.47
7.1.240.0060.00315.84
7.1.230.0070.01015.85
7.1.220.0000.00915.86
7.1.210.0120.00615.76
7.1.200.0090.00615.54
7.1.190.0000.01315.90
7.1.180.0030.00615.70
7.1.170.0030.01015.90
7.1.160.0030.01015.72
7.1.150.0000.00915.91
7.1.140.0000.00915.86
7.1.130.0000.01715.74
7.1.120.0070.00715.87
7.1.110.0000.01215.63
7.1.100.0070.00416.01
7.1.90.0110.00415.48
7.1.80.0000.00915.51
7.1.70.0070.00416.24
7.1.60.0050.00616.23
7.1.50.0090.00716.15
7.1.40.0040.01115.86
7.1.30.0040.01115.70
7.1.20.0070.00715.57
7.1.10.0040.00715.69
7.1.00.0030.03319.12
7.0.330.0070.00715.45
7.0.320.0070.00715.50
7.0.310.0070.01015.39
7.0.300.0000.01515.22
7.0.290.0130.00315.27
7.0.280.0130.00015.20
7.0.270.0060.00615.43
7.0.260.0070.00715.63
7.0.250.0120.00015.64
7.0.240.0000.01115.40
7.0.230.0030.01215.65
7.0.220.0090.00615.64
7.0.210.0060.00915.23
7.0.200.0050.00915.95
7.0.190.0100.00315.40
7.0.180.0030.01015.61
7.0.170.0040.00815.59
7.0.160.0070.00315.44
7.0.150.0040.00815.57
7.0.140.0030.03918.71
7.0.130.0040.01215.50
7.0.120.0030.01015.55
7.0.110.0120.00015.50
7.0.100.0110.03617.64
7.0.90.0200.03517.71
7.0.80.0050.02417.53
7.0.70.0090.03917.71
7.0.60.0080.03617.64
7.0.50.0060.03517.90
7.0.40.0070.04516.78
7.0.30.0090.03016.75
7.0.20.0070.03516.82
7.0.10.0060.03116.71
7.0.00.0080.03216.78
5.6.400.0160.00014.15
5.6.390.0070.00714.27
5.6.380.0050.00814.21
5.6.370.0080.00814.27
5.6.360.0110.00414.27
5.6.350.0030.00714.50
5.6.340.0040.01114.37
5.6.330.0060.00914.63
5.6.320.0070.00714.70
5.6.310.0000.01214.23
5.6.300.0040.01114.22
5.6.290.0000.02014.54
5.6.280.0020.04217.61
5.6.270.0000.01614.45
5.6.260.0040.00814.34
5.6.250.0120.03817.53
5.6.240.0070.04417.38
5.6.230.0060.03617.62
5.6.220.0030.04417.38
5.6.210.0060.04317.63
5.6.200.0070.04617.76
5.6.190.0020.04517.57
5.6.180.0080.02517.68
5.6.170.0110.03517.81
5.6.160.0090.02917.65
5.6.150.0050.02717.72
5.6.140.0050.04517.56
5.6.130.0070.04417.74
5.6.120.0070.02917.66
5.6.110.0060.04317.68
5.6.100.0050.04017.66
5.6.90.0110.04317.56
5.6.80.0070.04517.31
5.6.70.0080.03217.29
5.6.60.0070.02717.32
5.6.50.0100.04417.29
5.6.40.0130.04017.43
5.6.30.0050.04017.41
5.6.20.0070.02217.37
5.6.10.0100.04017.45
5.6.00.0050.03917.45
5.5.380.0070.04017.41
5.5.370.0130.03817.31
5.5.360.0100.04317.27
5.5.350.0050.02717.27
5.5.340.0060.04417.68
5.5.330.0090.03217.48
5.5.320.0030.04017.62
5.5.310.0070.02417.50
5.5.300.0060.03917.40
5.5.290.0070.04717.68
5.5.280.0120.03317.69
5.5.270.0060.04217.70
5.5.260.0070.03017.49
5.5.250.0100.03417.32
5.5.240.0030.04517.21
5.5.230.0000.04217.09
5.5.220.0080.03317.14
5.5.210.0100.02917.10
5.5.200.0080.03717.24
5.5.190.0120.03917.33
5.5.180.0090.03817.06
5.5.170.0110.00313.73
5.5.160.0040.03717.24
5.5.150.0050.04317.04
5.5.140.0030.04317.03
5.5.130.0100.04017.18
5.5.120.0100.04517.09
5.5.110.0140.03717.16
5.5.100.0020.05117.25
5.5.90.0110.03817.21
5.5.80.0070.03717.19
5.5.70.0090.02717.08
5.5.60.0080.02317.27
5.5.50.0070.04417.28
5.5.40.0030.03817.14
5.5.30.0020.03417.13
5.5.20.0020.04616.98
5.5.10.0080.02817.10
5.5.00.0080.02417.18
5.4.450.0030.04616.40
5.4.440.0060.04016.34
5.4.430.0080.03816.20
5.4.420.0030.04616.23
5.4.410.0080.03016.23
5.4.400.0020.02516.17
5.4.390.0040.02516.21
5.4.380.0050.03816.18
5.4.370.0050.03716.19
5.4.360.0070.03016.09
5.4.350.0050.03316.21
5.4.340.0080.04016.19
5.4.330.0050.00313.23
5.4.320.0000.04416.14
5.4.310.0030.04216.23
5.4.300.0120.03016.22
5.4.290.0050.04016.18
5.4.280.0040.02216.19
5.4.270.0060.03716.20
5.4.260.0090.03416.17
5.4.250.0030.03516.18
5.4.240.0050.04316.22
5.4.230.0050.04016.14
5.4.220.0030.02616.14
5.4.210.0020.02716.09
5.4.200.0110.03716.23
5.4.190.0050.04016.18
5.4.180.0050.03616.13
5.4.170.0020.04216.12
5.4.160.0070.03916.03
5.4.150.0030.02316.19
5.4.140.0050.02114.71
5.4.130.0080.02014.78
5.4.120.0090.02214.84
5.4.110.0100.03514.79
5.4.100.0100.03914.79
5.4.90.0030.04314.78
5.4.80.0050.02414.80
5.4.70.0050.04114.77
5.4.60.0020.02714.78
5.4.50.0050.03114.73
5.4.40.0030.02314.87
5.4.30.0020.04014.77
5.4.20.0050.02814.77
5.4.10.0030.04314.86
5.4.00.0030.04214.54
5.3.290.0030.02313.93
5.3.280.0030.03113.92
5.3.270.0030.02513.92
5.3.260.0060.02313.93
5.3.250.0040.02913.92
5.3.240.0050.04013.97
5.3.230.0100.03513.95
5.3.220.0020.03413.93
5.3.210.0060.04013.91
5.3.200.0000.04113.91
5.3.190.0030.02713.95
5.3.180.0020.04513.91
5.3.170.0070.02313.96
5.3.160.0110.02713.92
5.3.150.0030.04013.91
5.3.140.0060.04313.93
5.3.130.0080.04013.95
5.3.120.0000.04313.87
5.3.110.0080.03913.94
5.3.100.0070.03713.67
5.3.90.0070.04213.69
5.3.80.0100.02513.63
5.3.70.0070.03613.68
5.3.60.0100.03513.66
5.3.50.0050.02513.60
5.3.40.0080.04013.53
5.3.30.0050.03213.56
5.3.20.0090.01813.43
5.3.10.0070.03713.41
5.3.00.0000.02813.40
5.2.170.0100.03012.25
5.2.160.0070.06012.25
5.2.150.0070.05712.25
5.2.140.0130.04712.25
5.2.130.0000.03312.25
5.2.120.0070.05712.25
5.2.110.0100.03012.25
5.2.100.0000.07012.25
5.2.90.0030.06312.25
5.2.80.0000.06312.25
5.2.70.0070.04712.25
5.2.60.0100.05012.25
5.2.50.0070.05312.25
5.2.40.0070.03012.25
5.2.30.0030.04712.25
5.2.20.0070.06312.25
5.2.10.0070.05012.25
5.2.00.0000.06012.25
5.1.60.0030.04712.25
5.1.50.0070.05012.25
5.1.40.0030.03012.25
5.1.30.0100.05012.25
5.1.20.0070.05312.25
5.1.10.0000.05012.25
5.1.00.0030.05712.25
5.0.50.0000.04012.25
5.0.40.0000.04712.25
5.0.30.0030.06312.25
5.0.20.0000.04312.25
5.0.10.0070.04012.25
5.0.00.0070.05012.25
4.4.90.0030.03012.25
4.4.80.0070.03012.25
4.4.70.0000.03312.25
4.4.60.0000.02712.25
4.4.50.0000.03312.25
4.4.40.0000.03712.25
4.4.30.0000.03712.25
4.4.20.0030.03312.25
4.4.10.0100.02712.25
4.4.00.0070.02712.25
4.3.110.0130.02712.25
4.3.100.0030.03312.25
4.3.90.0000.03012.25
4.3.80.0000.05012.25
4.3.70.0030.03712.25
4.3.60.0070.01312.25
4.3.50.0000.03712.25
4.3.40.0030.05312.25
4.3.30.0000.01712.25
4.3.20.0000.03312.25
4.3.10.0030.02712.25
4.3.00.0030.01712.25

preferences:
67.11 ms | 401 KiB | 5 Q