3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testRegExp($regexp, $string) { $valid = preg_match($regexp, $string); echo $string. " - " . ($valid ? "valid" : "invalid") ."\n"; } function matchRegExp($regexp, $text){ if(preg_match($regexp, $text, $matches)){ print_r($matches); }else{ echo "no match in text: ".$text; } } // hledání emailu @seznam.cz v textu (zjednodušená verze) $regexpEmail = "/\b(?P<email>\w+@seznam\.cz)\b/"; matchRegExp($regexpEmail, "adsd dominik@seznam.cz ssdasd"); matchRegExp($regexpEmail, "adsd dominik@seam.cz ssdasd"); // validace IP adresy $regexpIp = "/^((25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]?\d?\d)$/"; echo "Test IP\n"; testRegExp($regexpIp, "10.1.0.1"); testRegExp($regexpIp, "199.1.0.1"); testRegExp($regexpIp, "255.1.0.1"); testRegExp($regexpIp, "256.1.0.1"); testRegExp($regexpIp, "260.1.0.1"); testRegExp($regexpIp, "300.1.0.1"); testRegExp($regexpIp, "1.0.1"); testRegExp($regexpIp, "125.1..1"); testRegExp($regexpIp, "192.11.168.255"); testRegExp($regexpIp, "192.11.168.256"); testRegExp($regexpIp, "192.11.168.300");

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.0060.01216.88
8.3.50.0230.01022.15
8.3.40.0060.00918.74
8.3.30.0070.00718.90
8.3.20.0080.00018.90
8.3.10.0040.00421.81
8.3.00.0080.00021.73
8.2.180.0070.01016.88
8.2.170.0110.00322.96
8.2.160.0070.00722.30
8.2.150.0000.00724.18
8.2.140.0000.00824.66
8.2.130.0080.00019.77
8.2.120.0000.00826.35
8.2.110.0070.00321.08
8.2.100.0080.00418.03
8.2.90.0000.00919.06
8.2.80.0070.00417.97
8.2.70.0050.00317.60
8.2.60.0040.00418.04
8.2.50.0060.00318.10
8.2.40.0040.00420.42
8.2.30.0080.00021.19
8.2.20.0000.00818.24
8.2.10.0030.00518.14
8.2.00.0040.00417.97
8.1.280.0150.00425.92
8.1.270.0060.00322.14
8.1.260.0040.00428.09
8.1.250.0030.00528.09
8.1.240.0100.00720.88
8.1.230.0110.00017.83
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0070.00317.48
8.1.190.0040.00417.36
8.1.180.0030.00618.10
8.1.170.0000.00818.76
8.1.160.0070.00022.22
8.1.150.0000.00818.99
8.1.140.0030.00519.53
8.1.130.0040.00417.93
8.1.120.0000.00817.52
8.1.110.0000.00717.55
8.1.100.0040.00417.51
8.1.90.0040.00417.66
8.1.80.0040.00417.68
8.1.70.0000.00717.61
8.1.60.0070.00417.60
8.1.50.0000.00817.58
8.1.40.0030.00517.56
8.1.30.0030.00617.80
8.1.20.0000.00817.68
8.1.10.0030.00617.64
8.1.00.0040.00417.66
8.0.300.0040.00418.77
8.0.290.0060.00316.75
8.0.280.0000.00718.40
8.0.270.0000.00717.19
8.0.260.0000.00717.33
8.0.250.0000.00717.10
8.0.240.0040.00417.03
8.0.230.0040.00417.14
8.0.220.0040.00417.00
8.0.210.0000.00817.06
8.0.200.0040.00416.98
8.0.190.0000.01016.99
8.0.180.0030.00517.06
8.0.170.0000.00817.07
8.0.160.0050.00216.89
8.0.150.0000.00817.00
8.0.140.0040.00416.88
8.0.130.0000.00613.50
8.0.120.0040.00417.07
8.0.110.0070.00016.98
8.0.100.0000.00717.10
8.0.90.0000.00817.05
8.0.80.0080.00816.99
8.0.70.0040.00416.98
8.0.60.0030.00517.13
8.0.50.0070.00017.07
8.0.30.0110.00917.43
8.0.20.0130.00917.40
8.0.10.0050.00317.16
8.0.00.0060.01216.85
7.4.330.0000.00615.55
7.4.320.0060.00016.75
7.4.300.0030.00316.69
7.4.290.0070.00016.76
7.4.280.0030.00616.79
7.4.270.0000.00716.75
7.4.260.0030.00316.86
7.4.250.0050.00316.85
7.4.240.0070.00016.85
7.4.230.0070.00016.89
7.4.220.0070.01316.76
7.4.210.0090.00816.86
7.4.200.0030.00316.68
7.4.160.0130.00616.79
7.4.150.0110.00717.40
7.4.140.0140.01217.86
7.4.130.0120.00716.79
7.4.120.0110.00716.78
7.4.110.0040.02116.70
7.4.100.0120.00616.67
7.4.90.0070.01316.54
7.4.80.0110.00719.39
7.4.70.0090.00916.61
7.4.60.0130.00316.80
7.4.50.0000.01716.55
7.4.40.0090.00916.69
7.4.30.0090.00916.75
7.4.00.0000.01715.37
7.3.330.0000.00513.45
7.3.320.0030.00313.52
7.3.310.0030.00316.31
7.3.300.0070.00016.38
7.3.290.0000.00716.28
7.3.280.0040.01516.48
7.3.270.0070.01017.40
7.3.260.0080.01016.69
7.3.250.0080.01016.53
7.3.240.0120.00616.61
7.3.230.0110.00816.72
7.3.210.0110.00616.65
7.3.200.0000.01616.60
7.3.190.0090.01216.78
7.3.180.0070.01016.45
7.3.170.0070.01016.77
7.3.160.0060.01216.55
7.2.330.0060.01216.79
7.2.320.0090.01516.89
7.2.310.0030.01316.80
7.2.300.0120.00616.84
7.2.290.0090.00916.79
7.2.00.0040.00819.79
7.1.70.0030.00617.14
7.1.60.0070.00317.46
7.1.00.0130.06722.59
7.0.200.0240.00814.98
7.0.120.0170.05322.02
7.0.110.0070.06721.93
7.0.100.0130.05722.07
7.0.90.0200.05322.13
7.0.80.0070.07322.16
7.0.70.0130.05322.20
7.0.60.0030.08322.09
7.0.50.0230.04722.03
7.0.40.0200.04722.02
7.0.30.0100.07722.04
7.0.20.0130.05321.96
7.0.10.0130.05022.12
7.0.00.0130.05721.95
5.6.270.0070.06721.09
5.6.260.0030.06321.00
5.6.250.0230.06021.05
5.6.240.0170.05720.95
5.6.230.0170.05720.83
5.6.220.0170.05320.87
5.6.210.0170.05721.03
5.6.200.0100.08321.00
5.6.190.0030.06720.96
5.6.180.0100.06720.95
5.6.170.0170.05020.84
5.6.160.0200.05020.96
5.6.150.0200.05320.91
5.6.140.0200.05021.07
5.6.130.0030.06321.00
5.6.120.0130.05720.83
5.6.110.0170.05721.02
5.6.100.0200.05020.97
5.6.90.0170.05720.80
5.6.80.0070.05720.10
5.6.70.0170.04720.16
5.6.60.0170.05020.21
5.6.50.0130.05020.20
5.6.40.0170.05320.38
5.6.30.0200.05020.20
5.6.20.0130.05320.32
5.6.10.0170.05320.33
5.6.00.0130.05720.41

preferences:
49.02 ms | 401 KiB | 5 Q