3v4l.org

run code in 300+ PHP versions simultaneously
<?php $valid = array('first.last@iana.org', '1234567890123456789012345678901234567890123456789012345678901234@iana.org', '"first\"last"@iana.org', '"first@last"@iana.org', '"first\last"@iana.org', //'x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789', //'1234567890123456789012345678901234567890123456789012345678@1234567890123456789012345678901234567890123456 [...]', 'first.last@[12.34.56.78]', 'first.last@[IPv6:::12.34.56.78]', 'first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]', 'first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.56.78]', 'first.last@[IPv6:::1111:2222:3333:4444:5555:6666]', 'first.last@[IPv6:1111:2222:3333::4444:5555:6666]', 'first.last@[IPv6:1111:2222:3333:4444:5555:6666::]', 'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888]', 'first.last@x23456789012345678901234567890123456789012345678901234567890123.iana.org', 'first.last@3com.com', 'first.last@123.iana.org', '"first\last"@iana.org', 'first.last@[IPv6:1111:2222:3333::4444:5555:12.34.56.78]', 'first.last@[IPv6:1111:2222:3333::4444:5555:6666:7777]', 'first.last@example.123', 'first.last@com', '"Abc\@def"@iana.org', '"Fred\ Bloggs"@iana.org', '"Joe.\Blow"@iana.org', '"Abc@def"@iana.org', '"Fred Bloggs"@iana.org', 'user+mailbox@iana.org', 'customer/department=shipping@iana.org', '$A12345@iana.org', '!def!xyz%abc@iana.org', '_somename@iana.org', 'dclo@us.ibm.com', 'peter.piper@iana.org', '"Doug \"Ace\" L."@iana.org', 'test@iana.org', 'TEST@iana.org', '1234567890@iana.org', 'test+test@iana.org', 'test-test@iana.org', 't*est@iana.org', '+1~1+@iana.org', '{_test_}@iana.org', '"[[ test ]]"@iana.org', 'test.test@iana.org', '"test.test"@iana.org', 'test."test"@iana.org', '"test@test"@iana.org', 'test@123.123.123.x123', 'test@123.123.123.123', 'test@[123.123.123.123]', 'test@example.iana.org', 'test@example.example.iana.org', '"test\test"@iana.org', 'test@example', '"test\blah"@iana.org', '"test\blah"@iana.org', '"test\"blah"@iana.org', 'customer/department@iana.org', '_Yosemite.Sam@iana.org', '~@iana.org', '"Austin@Powers"@iana.org', 'Ima.Fool@iana.org', '"Ima.Fool"@iana.org', '"Ima Fool"@iana.org', '"first"."last"@iana.org', '"first".middle."last"@iana.org', '"first".last@iana.org', 'first."last"@iana.org', '"first"."middle"."last"@iana.org', '"first.middle"."last"@iana.org', '"first.middle.last"@iana.org', '"first..last"@iana.org', '"first\\\"last"@iana.org', 'first."mid\dle"."last"@iana.org', '"test blah"@iana.org', '(foo)cal(bar)@(baz)iamcal.com(quux)', 'cal@iamcal(woo).(yay)com', 'cal(woo(yay)hoopla)@iamcal.com', 'cal(foo\@bar)@iamcal.com', 'cal(foo\)bar)@iamcal.com', 'first().last@iana.org', 'pete(his account)@silly.test(his host)', 'c@(Chris\'s host.)public.example', 'jdoe@machine(comment). example', '1234 @ local(blah) .machine .example', 'first(abc.def).last@iana.org', 'first(a"bc.def).last@iana.org', 'first.(")middle.last(")@iana.org', 'first(abc\(def)@iana.org', 'first.last@x(1234567890123456789012345678901234567890123456789012345678901234567890).com', 'a(a(b(c)d(e(f))g)h(i)j)@iana.org', 'name.lastname@domain.com', 'a@b', 'a@bar.com', 'aaa@[123.123.123.123]', 'a@bar', 'a-b@bar.com', '+@b.c', '+@b.com', 'a@b.co-foo.uk', '"hello my name is"@stutter.com', '"Test \"Fail\" Ing"@iana.org@about.museum', 'shaitan@my-domain.thisisminekthx', 'foobar@192.168.0.1', '"Joe\Blow"@iana.org', 'HM2Kinsists@(that comments are allowed)this.is.ok', 'user%uucp!path@berkeley.edu', 'first.last @iana.org', 'cdburgess+!#$%&\'*-/=?+_{}|~test@gmail.com', 'first.last@[IPv6:::a2:a3:a4:b1:b2:b3:b4]', 'first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3::]', 'first.last@[IPv6:::]', 'first.last@[IPv6:::b4]', 'first.last@[IPv6:::b3:b4]', 'first.last@[IPv6:a1::b4]', 'first.last@[IPv6:a1::]', 'first.last@[IPv6:a1:a2::]', 'first.last@[IPv6:0123:4567:89ab:cdef::]', 'first.last@[IPv6:0123:4567:89ab:CDEF::]', 'first.last@[IPv6:::a3:a4:b1:ffff:11.22.33.44]', 'first.last@[IPv6:::a2:a3:a4:b1:ffff:11.22.33.44]', 'first.last@[IPv6:a1:a2:a3:a4::11.22.33.44]', 'first.last@[IPv6:a1:a2:a3:a4:b1::11.22.33.44]', 'first.last@[IPv6:a1::11.22.33.44]', 'first.last@[IPv6:a1:a2::11.22.33.44]', 'first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.44]', 'first.last@[IPv6:0123:4567:89ab:CDEF::11.22.33.44]', 'first.last@[IPv6:a1::b2:11.22.33.44]', 'test@test.com', 'test@xn--example.com', 'test@example.com', ); $invalid = array( 'first.last@sub.do,com', 'first\@last@iana.org', //'123456789012345678901234567890123456789012345678901234567890@12345678901234567890123456789012345678901234 [...]', 'first.last', '12345678901234567890123456789012345678901234567890123456789012345@iana.org', '.first.last@iana.org', 'first.last.@iana.org', 'first..last@iana.org', '"first"last"@iana.org', '"""@iana.org', '"\"@iana.org', '""@iana.org', 'first\@last@iana.org', 'first.last@', //'x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23 [...]', 'first.last@[.12.34.56.78]', 'first.last@[12.34.56.789]', 'first.last@[::12.34.56.78]', 'first.last@[IPv5:::12.34.56.78]', 'first.last@[IPv6:1111:2222:3333:4444:5555:12.34.56.78]', 'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:12.34.56.78]', 'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777]', 'first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888:9999]', 'first.last@[IPv6:1111:2222::3333::4444:5555:6666]', 'first.last@[IPv6:1111:2222:333x::4444:5555]', 'first.last@[IPv6:1111:2222:33333::4444:5555]', 'first.last@-xample.com', 'first.last@exampl-.com', 'first.last@x234567890123456789012345678901234567890123456789012345678901234.iana.org', 'abc\@def@iana.org', 'abc\@iana.org', 'Doug\ \"Ace\"\ Lovell@iana.org', 'abc@def@iana.org', 'abc\@def@iana.org', 'abc\@iana.org', '@iana.org', 'doug@', '"qu@iana.org', 'ote"@iana.org', '.dot@iana.org', 'dot.@iana.org', 'two..dot@iana.org', '"Doug "Ace" L."@iana.org', 'Doug\ \"Ace\"\ L\.@iana.org', 'hello world@iana.org', 'gatsby@f.sc.ot.t.f.i.tzg.era.l.d.', 'test.iana.org', 'test.@iana.org', 'test..test@iana.org', '.test@iana.org', 'test@test@iana.org', 'test@@iana.org', '-- test --@iana.org', '[test]@iana.org', '"test"test"@iana.org', '()[]\;:,><@iana.org', 'test@.', 'test@example.', 'test@.org', //'test@1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 [...]', 'test@[123.123.123.123', 'test@123.123.123.123]', 'NotAnEmail', '@NotAnEmail', '"test"blah"@iana.org', '.wooly@iana.org', 'wo..oly@iana.org', 'pootietang.@iana.org', '.@iana.org', 'Ima Fool@iana.org', 'phil.h\@\@ck@haacked.com', 'foo@[\1.2.3.4]', 'first."".last@iana.org', 'first\last@iana.org', 'Abc\@def@iana.org', 'Fred\ Bloggs@iana.org', 'Joe.\Blow@iana.org', 'first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.567.89]', '{^c\@**Dog^}@cartoon.com', '"foo"(yay)@(hoopla)[1.2.3.4]', 'cal(foo(bar)@iamcal.com', 'cal(foo)bar)@iamcal.com', 'cal(foo\)@iamcal.com', //'first(12345678901234567890123456789012345678901234567890)last@(123456789012345678901234567890123456789012 [...]', 'first(middle)last@iana.org', //'first(abc("def".ghi).mno)middle(abc("def".ghi).mno).last@(abc("def".ghi).mno)example(abc("def".ghi).mno). [...]', 'a(a(b(c)d(e(f))g)(h(i)j)@iana.org', '.@', '@bar.com', '@@bar.com', 'aaa.com', 'aaa@.com', 'aaa@.123', 'aaa@[123.123.123.123]a', 'aaa@[123.123.123.333]', 'a@bar.com.', 'a@-b.com', 'a@b-.com', '-@..com', '-@a..com@about.museum-', 'test@...........com', '"Unicode NULL "@char.com', 'Unicode NULL @char.com', 'first.last@[IPv6::]', 'first.last@[IPv6::::]', 'first.last@[IPv6::b4]', 'first.last@[IPv6::::b4]', 'first.last@[IPv6::b3:b4]', 'first.last@[IPv6::::b3:b4]', 'first.last@[IPv6:a1:::b4]', 'first.last@[IPv6:a1:]', 'first.last@[IPv6:a1:::]', 'first.last@[IPv6:a1:a2:]', 'first.last@[IPv6:a1:a2:::]', 'first.last@[IPv6::11.22.33.44]', 'first.last@[IPv6::::11.22.33.44]', 'first.last@[IPv6:a1:11.22.33.44]', 'first.last@[IPv6:a1:::11.22.33.44]', 'first.last@[IPv6:a1:a2:::11.22.33.44]', 'first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.xx]', 'first.last@[IPv6:0123:4567:89ab:CDEFF::11.22.33.44]', 'first.last@[IPv6:a1::a4:b1::b4:11.22.33.44]', 'first.last@[IPv6:a1::11.22.33]', 'first.last@[IPv6:a1::11.22.33.44.55]', 'first.last@[IPv6:a1::b211.22.33.44]', 'first.last@[IPv6:a1::b2::11.22.33.44]', 'first.last@[IPv6:a1::b3:]', 'first.last@[IPv6::a2::b4]', 'first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3:]', 'first.last@[IPv6::a2:a3:a4:b1:b2:b3:b4]', 'first.last@[IPv6:a1:a2:a3:a4::b1:b2:b3:b4]', ); $counter = 0; foreach ($valid as $adr) { if ($adr !== filter_var($adr, FILTER_VALIDATE_EMAIL)) { $counter++; //echo "$adr INVALID when it should be VALID\n"; } } foreach ($invalid as $adr) { if (false !== filter_var($adr, FILTER_VALIDATE_EMAIL)) { $counter++; //echo "$adr VALID when it should be INVALID\n"; } } echo $counter, "\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.60.0070.01019.05
8.3.50.0110.00822.15
8.3.40.0030.01419.15
8.3.30.0100.00619.36
8.3.20.0050.00320.54
8.3.10.0090.00022.32
8.3.00.0060.00318.18
8.2.180.0140.01017.13
8.2.170.0070.01022.96
8.2.160.0090.00620.85
8.2.150.0090.00024.18
8.2.140.0060.00324.66
8.2.130.0090.00626.16
8.2.120.0080.00021.24
8.2.110.0070.00422.46
8.2.100.0060.00620.20
8.2.90.0060.00319.55
8.2.80.0030.00718.13
8.2.70.0030.00618.25
8.2.60.0030.00718.30
8.2.50.0060.00318.07
8.2.40.0030.00618.62
8.2.30.0060.00318.41
8.2.20.0040.00818.22
8.2.10.0060.00318.51
8.2.00.0030.00718.25
8.1.280.0080.01525.92
8.1.270.0050.00524.29
8.1.260.0060.00326.35
8.1.250.0110.00028.09
8.1.240.0070.00324.09
8.1.230.0080.00419.35
8.1.220.0070.00318.03
8.1.210.0090.00018.77
8.1.200.0050.00518.00
8.1.190.0030.00617.72
8.1.180.0030.00618.10
8.1.170.0000.00919.06
8.1.160.0050.00522.28
8.1.150.0000.00819.25
8.1.140.0000.00817.80
8.1.130.0050.00318.00
8.1.120.0040.00417.83
8.1.110.0000.00917.91
8.1.100.0060.00317.91
8.1.90.0040.00817.92
8.1.80.0030.00617.75
8.1.70.0000.00817.82
8.1.60.0000.00917.96
8.1.50.0000.00917.88
8.1.40.0050.00617.82
8.1.30.0000.01018.00
8.1.20.0030.00618.03
8.1.10.0000.00817.73
8.1.00.0030.00919.82
8.0.300.0000.00818.77
8.0.290.0040.00417.00
8.0.280.0000.00818.73
8.0.270.0030.00517.41
8.0.260.0040.00417.59
8.0.250.0000.00817.31
8.0.240.0030.00617.20
8.0.230.0060.00317.17
8.0.220.0000.00817.26
8.0.210.0050.00317.26
8.0.200.0000.00917.24
8.0.190.0030.00717.20
8.0.180.0030.00517.14
8.0.170.0030.00717.20
8.0.160.0040.00417.26
8.0.150.0040.00417.11
8.0.140.0070.00317.21
8.0.130.0020.00513.53
8.0.120.0030.00617.27
8.0.110.0030.00617.27
8.0.100.0030.00617.29
8.0.90.0000.00817.32
8.0.80.0090.00917.33
8.0.70.0060.00317.11
8.0.60.0040.00417.32
8.0.50.0000.00817.25
8.0.30.0170.00917.34
8.0.20.0140.00817.56
8.0.10.0040.00417.27
8.0.00.0110.01017.19
7.4.330.0030.00315.39
7.4.320.0020.00517.12
7.4.300.0050.00317.08
7.4.290.0000.01017.00
7.4.280.0000.00917.04
7.4.270.0030.00617.00
7.4.260.0000.00816.97
7.4.250.0080.00016.95
7.4.240.0000.00816.99
7.4.230.0050.00317.06
7.4.220.0110.01116.91
7.4.210.0150.01217.13
7.4.200.0030.00617.01
7.4.160.0040.01417.01
7.4.150.0100.01017.40
7.4.140.0100.01017.86
7.4.130.0160.00816.97
7.4.120.0080.01116.98
7.4.110.0090.00916.99
7.4.100.0080.01216.91
7.4.90.0110.00816.91
7.4.80.0150.01119.39
7.4.70.0190.00716.85
7.4.60.0100.01016.84
7.4.50.0000.00816.70
7.4.40.0060.01216.75
7.4.30.0060.01216.75
7.4.00.0040.01415.47
7.3.330.0070.00013.53
7.3.320.0030.00313.59
7.3.310.0000.00816.74
7.3.300.0000.00816.57
7.3.290.0070.01016.75
7.3.280.0060.01516.71
7.3.270.0100.01017.40
7.3.260.0030.01516.70
7.3.240.0100.00916.78
7.3.230.0030.01716.67
7.3.210.0090.00917.13
7.3.200.0120.01319.39
7.3.190.0090.01216.99
7.3.180.0070.01316.59
7.3.170.0000.01816.63
7.3.160.0100.00716.86
7.3.120.0040.01115.50
7.3.10.0030.01216.64
7.3.00.0050.00717.01
7.2.330.0060.01816.83
7.2.320.0150.00617.05
7.2.310.0150.00616.92
7.2.300.0100.01316.94
7.2.290.0070.01716.95
7.2.130.0070.01117.16
7.2.120.0060.01316.87
7.2.110.0080.00817.00
7.2.100.0030.01617.02
7.2.90.0070.01417.14
7.2.80.0060.01317.07
7.2.70.0000.02116.88
7.2.60.0020.01617.09
7.2.50.0060.01317.21
7.2.40.0070.01317.35
7.2.30.0090.00916.96
7.2.20.0070.01017.10
7.2.10.0030.01216.73
7.2.00.0110.00717.04
7.1.250.0090.00915.88
7.1.200.0070.00316.01
7.1.70.0050.00517.26
7.1.60.0150.01519.25
7.1.50.0120.01517.54
7.1.00.0030.08022.46
7.0.200.0000.01017.13
7.0.140.0030.07722.47
7.0.60.0100.04320.20
7.0.50.0070.08018.12
7.0.40.0130.08320.21
7.0.30.0530.05720.20
7.0.20.0170.05320.25
7.0.10.0100.06320.17
7.0.00.0100.04720.45
5.6.280.0100.07321.24
5.6.210.0070.08720.64
5.6.200.0170.03718.30
5.6.190.0030.09320.46
5.6.180.0070.06020.33
5.6.170.0370.07320.50
5.6.160.0130.08720.50
5.6.150.0000.04318.23
5.6.140.0070.03718.31
5.6.130.0200.05718.21
5.6.120.0100.08721.11
5.6.110.0000.04721.23
5.6.100.0170.08321.11
5.6.90.0130.08321.14
5.6.80.0000.05720.53
5.6.70.4400.04320.61
5.5.350.0170.04320.52
5.5.340.0000.05318.11
5.5.330.0030.08320.46
5.5.320.3770.04320.30
5.5.310.0270.07720.34
5.5.300.0030.08318.11
5.5.290.0100.04018.08
5.5.280.0100.06020.96
5.5.270.0030.04720.91
5.5.260.0070.07320.88
5.5.250.0000.07020.91
5.5.240.0230.07020.48
5.4.450.0270.04319.16
5.4.440.0100.05719.65
5.4.430.0170.05019.44
5.4.420.0200.04719.19
5.4.410.0100.05319.39
5.4.400.0130.04319.02
5.4.390.0600.02719.27
5.4.380.0800.06718.80
5.4.370.0770.06018.86
5.4.360.0900.06018.82
5.4.350.0500.05718.84
5.4.340.0170.05018.87
5.4.320.0030.04512.71
5.4.310.0070.04612.70
5.4.300.0040.05312.71
5.4.290.0070.04112.71
5.4.280.0020.04512.60
5.4.270.0080.04712.60
5.4.260.0070.04412.60
5.4.250.0070.04112.60
5.4.240.0050.04112.61
5.4.230.0070.04112.60
5.4.220.0080.04212.60
5.4.210.0070.03712.59
5.4.200.0040.04412.59
5.4.190.0030.04312.59
5.4.180.0040.04312.59
5.4.170.0080.04812.60
5.4.160.0080.04912.59
5.4.150.0090.03812.60
5.4.140.0050.04112.28
5.4.130.0080.03812.26
5.4.120.0090.04212.29
5.4.110.0040.04612.28
5.4.100.0060.04012.28
5.4.90.0050.04312.27
5.4.80.0050.05012.28
5.4.70.0050.04212.28
5.4.60.0040.04112.27
5.4.50.0020.04312.27
5.4.40.0060.03912.27
5.4.30.0020.04312.26
5.4.20.0050.04212.26
5.4.10.0040.04812.26
5.4.00.0050.04111.71
5.3.290.0060.05012.95
5.3.280.0070.04212.87
5.3.270.0050.04512.88
5.3.260.0040.04612.88
5.3.250.0060.04312.88
5.3.240.0050.04412.88
5.3.230.0060.04112.88
5.3.220.0030.04512.90
5.3.210.0060.04712.90
5.3.200.0060.04612.90
5.3.190.0040.04512.91
5.3.180.0050.04312.90
5.3.170.0060.04612.91
5.3.160.0080.03912.90
5.3.150.0060.04112.91
5.3.140.0070.04212.89
5.3.130.0080.04312.89
5.3.120.0080.04012.89
5.3.110.0050.04412.89
5.3.100.0070.04012.38
5.3.90.0060.04112.32
5.3.80.0050.04012.30
5.3.70.0050.03912.30
5.3.60.0090.03812.29
5.3.50.0090.04812.23
5.3.40.0070.04212.23
5.3.30.0080.04812.20
5.3.20.0050.03811.86
5.3.10.0040.03911.83
5.3.00.0070.04011.81
5.2.170.0050.0369.43
5.2.160.0100.0429.43
5.2.150.0060.0489.43
5.2.140.0050.0379.42
5.2.130.0090.0289.27
5.2.120.0050.0339.29
5.2.110.0040.0369.28
5.2.100.0060.0329.28
5.2.90.0030.0329.27
5.2.80.0030.0349.26
5.2.70.0060.0339.27
5.2.60.0040.0329.22
5.2.50.0050.0299.19
5.2.40.0040.0309.18
5.2.30.0070.0309.15
5.2.20.0080.0269.15
5.2.10.0050.0299.07
5.2.00.0050.0288.93
5.1.60.0020.0288.17
5.1.50.0080.0218.17
5.1.40.0040.0298.15
5.1.30.0040.0268.50
5.1.20.0030.0298.52
5.1.10.0030.0268.24
5.1.00.0040.0268.25
5.0.50.0030.0216.73
5.0.40.0040.0196.59
5.0.30.0020.0336.40
5.0.20.0070.0246.37
5.0.10.0030.0246.35
5.0.00.0040.0326.34
4.4.90.0060.0124.78
4.4.80.0030.0154.75
4.4.70.0040.0174.76
4.4.60.0010.0194.75
4.4.50.0020.0164.77
4.4.40.0020.0264.72
4.4.30.0010.0184.76
4.4.20.0010.0174.84
4.4.10.0020.0174.85
4.4.00.0030.0264.76
4.3.110.0060.0134.67
4.3.100.0020.0164.67
4.3.90.0020.0154.64
4.3.80.0030.0264.63
4.3.70.0020.0154.63
4.3.60.0040.0144.63
4.3.50.0020.0174.63
4.3.40.0010.0254.58
4.3.30.0010.0173.39
4.3.20.0040.0193.37
4.3.10.0010.0183.32
4.3.00.0070.01315.28

preferences:
48.29 ms | 401 KiB | 5 Q