3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = ' <span class="phone-number" data-id="999" style="{lots of random stuff here}">+61 9900 0000</span> <span class="email" data-something="xxx" style="{lots of random stuff here}">test@test.com</span> '; $dom = new DOMDocument; $dom->loadHtml($html); $xpath = new DOMXPath($dom); $phone = $xpath->query("//span[contains(@class, 'phone-number')]"); $email = $xpath->query("//span[contains(@class, 'email')]"); echo $phone->item(0)->nodeValue.PHP_EOL; echo $email->item(0)->nodeValue.PHP_EOL; /* foreach ($phone as $value) { echo $value->nodeValue; } */

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.120.0110.00924.29
8.4.110.0150.00519.27
8.4.100.0120.00918.41
8.4.90.0110.01020.91
8.4.80.0100.00319.09
8.4.70.0100.01019.42
8.4.60.0120.00919.11
8.4.50.0110.00919.11
8.4.40.0040.00417.99
8.4.30.0160.00318.09
8.4.20.0070.01020.03
8.4.10.0000.01117.99
8.3.250.0050.00217.64
8.3.240.0140.00517.48
8.3.230.0150.00416.80
8.3.220.0120.00819.11
8.3.210.0100.01016.83
8.3.200.0070.00216.84
8.3.190.0050.00419.31
8.3.180.0100.01019.24
8.3.170.0150.00317.45
8.3.160.0120.00617.27
8.3.150.0120.00617.31
8.3.140.0030.00617.65
8.3.130.0030.01718.68
8.3.120.0120.00319.20
8.3.110.0050.00320.94
8.3.100.0080.00024.06
8.3.90.0100.01026.77
8.3.80.0000.00917.00
8.3.70.0070.01416.75
8.3.60.0040.01518.66
8.3.50.0080.00817.66
8.3.40.0040.01119.09
8.3.30.0040.01118.92
8.3.20.0040.00420.63
8.3.10.0080.00023.86
8.3.00.0080.00019.46
8.2.290.0090.00922.70
8.2.280.0050.00518.62
8.2.270.0090.00617.04
8.2.260.0040.00818.65
8.2.250.0060.00317.09
8.2.240.0030.00619.34
8.2.230.0040.00422.58
8.2.220.0060.00337.54
8.2.210.0080.00026.77
8.2.200.0030.00616.75
8.2.190.0110.00417.13
8.2.180.0090.00618.64
8.2.170.0120.00322.96
8.2.160.0090.00620.76
8.2.150.0150.00024.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0030.00521.49
8.2.110.0110.00320.64
8.2.100.0080.00418.28
8.2.90.0040.00418.00
8.2.80.0090.00019.04
8.2.70.0030.00618.30
8.2.60.0040.00418.18
8.2.50.0000.00818.47
8.2.40.0050.00320.73
8.2.30.0000.00819.83
8.2.20.0030.00618.36
8.2.10.0040.00418.44
8.2.00.0040.00418.59
8.1.330.0120.00722.46
8.1.320.0110.01117.96
8.1.310.0040.00417.02
8.1.300.0070.01016.71
8.1.290.0100.00018.88
8.1.280.0070.01025.92
8.1.270.0030.00522.39
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0030.00719.37
8.1.230.0080.00418.02
8.1.220.0050.00318.16
8.1.210.0080.00018.77
8.1.200.0060.00317.60
8.1.190.0060.00317.60
8.1.180.0080.00018.10
8.1.170.0050.00320.66
8.1.160.0050.00319.19
8.1.150.0040.00419.18
8.1.140.0000.00719.51
8.1.130.0000.00717.82
8.1.120.0030.00317.76
8.1.110.0040.00417.75
8.1.100.0040.00417.67
8.1.90.0000.00817.75
8.1.80.0050.00317.83
8.1.70.0000.00717.80
8.1.60.0050.00317.79
8.1.50.0040.00417.91
8.1.40.0000.00817.75
8.1.30.0000.00817.89
8.1.20.0070.00018.03
8.1.10.0040.00417.87
8.1.00.0040.00417.85
8.0.300.0040.00418.77
8.0.290.0020.00516.88
8.0.280.0040.00418.87
8.0.270.0000.00817.53
8.0.260.0000.00717.20
8.0.250.0030.00317.20
8.0.240.0040.00417.35
8.0.230.0030.00617.17
8.0.220.0040.00417.25
8.0.210.0040.00417.27
8.0.200.0070.00017.32
8.0.190.0040.00717.29
8.0.180.0040.00417.24
8.0.170.0030.00617.26
8.0.160.0050.00217.28
8.0.150.0000.01117.20
8.0.140.0040.00417.10
8.0.130.0000.00613.76
8.0.120.0030.00617.21
8.0.110.0040.00417.11
8.0.100.0000.00817.33
8.0.90.0040.00417.24
8.0.80.0060.01617.21
8.0.70.0000.00817.17
8.0.60.0030.00517.31
8.0.50.0040.00417.09
8.0.30.0170.01317.51
8.0.20.0120.00817.40
8.0.10.0000.00817.19
8.0.00.0100.00717.11
7.4.330.0030.00315.55
7.4.320.0000.00616.84
7.4.300.0050.00316.86
7.4.290.0000.00716.71
7.4.280.0000.00716.94
7.4.270.0000.00816.90
7.4.260.0040.00416.78
7.4.250.0040.00416.96
7.4.240.0040.00416.86
7.4.230.0040.00416.65
7.4.220.0060.00316.63
7.4.210.0030.01116.96
7.4.200.0070.00016.87
7.4.160.0100.00616.68
7.4.150.0090.00917.40
7.4.140.0070.01217.86
7.4.130.0130.01016.77
7.4.120.0140.00716.83
7.4.110.0170.00016.70
7.4.100.0120.00916.69
7.4.90.0140.00316.81
7.4.80.0140.00319.39
7.4.70.0060.00916.82
7.4.60.0040.01116.80
7.4.50.0000.01316.50
7.4.40.0120.01016.66
7.4.10.0070.01416.52
7.4.00.0070.01015.82
7.3.330.0050.00013.25
7.3.320.0030.00313.45
7.3.310.0040.00416.60
7.3.300.0000.00716.40
7.3.290.0100.00716.52
7.3.280.0090.00916.58
7.3.270.0170.00017.40
7.3.260.0060.01416.71
7.3.250.0100.01016.85
7.3.240.0100.01116.76
7.3.230.0140.00316.63
7.3.210.0060.01016.74
7.3.200.0100.01316.88
7.3.190.0090.00916.57
7.3.180.0130.00716.79
7.3.170.0060.01216.56
7.3.160.0110.00516.56
7.3.130.0000.01916.61
7.3.120.0150.00416.43
7.3.110.0080.00816.73
7.3.100.0070.00716.36
7.3.90.0070.01116.75
7.3.80.0120.00316.68
7.3.70.0030.00916.68
7.3.60.0090.00616.59
7.3.50.0040.00816.52
7.3.40.0030.00716.50
7.3.30.0070.00316.73
7.3.20.0090.00318.29
7.3.10.0050.01117.24
7.3.00.0050.00917.24
7.2.330.0060.01517.10
7.2.320.0100.00716.88
7.2.310.0030.01317.14
7.2.300.0080.01016.82
7.2.290.0070.01017.14
7.2.260.0140.00716.66
7.2.250.0140.00316.79
7.2.240.0130.00316.96
7.2.230.0070.01017.16
7.2.220.0070.01116.98
7.2.210.0000.01316.98
7.2.200.0090.00616.66
7.2.190.0000.01216.78
7.2.180.0070.01016.78
7.2.170.0070.00716.84
7.2.160.0090.00616.94
7.2.150.0090.00918.68
7.2.140.0050.00518.85
7.2.130.0040.00917.67
7.2.120.0020.01217.48
7.2.110.0070.00717.61
7.2.100.0080.00617.50
7.2.90.0060.00817.58
7.2.80.0100.00617.45
7.2.70.0040.00917.55
7.2.60.0050.00917.43
7.2.50.0060.01017.58
7.2.40.0070.00617.66
7.2.30.0090.00617.53
7.2.20.0040.01117.48
7.2.10.0140.00817.62
7.2.00.0140.01117.60
7.1.330.0040.01217.61
7.1.320.0070.01117.54
7.1.310.0060.00917.79
7.1.300.0040.00717.53
7.1.290.0080.00417.61
7.1.280.0080.00417.58
7.1.270.0030.01517.53
7.1.260.0000.01417.60
7.1.250.0020.01016.40
7.1.240.0070.00717.50
7.1.230.0030.01317.61
7.1.220.0080.00317.58
7.1.210.0070.01017.52
7.1.200.0090.00916.53
7.1.190.0080.00817.55
7.1.180.0040.01417.57
7.1.170.0130.00617.47
7.1.160.0000.01117.64
7.1.150.0080.00317.53
7.1.140.0060.00617.52
7.1.130.0350.00417.04
7.1.120.0210.00817.20
7.1.110.0340.00816.95
7.1.100.0170.00917.04
7.1.90.0210.00916.73
7.1.80.0270.00516.59
7.1.70.0120.01016.37
7.1.60.0130.00825.35
7.1.50.0290.00725.34
7.1.40.0330.01325.17
7.1.30.0340.01225.13
7.1.20.0290.00925.25
7.1.10.0240.00716.17
7.1.00.0160.01116.38
7.0.330.0000.00917.42
7.0.320.0090.00917.39
7.0.310.0070.01117.48
7.0.300.0070.01017.33
7.0.290.0040.01117.21
7.0.280.0060.00617.31
7.0.270.0030.01317.46
7.0.260.0100.00317.23
7.0.250.0040.00817.31
7.0.240.0030.01017.11
7.0.230.0100.00617.46
7.0.220.0000.01817.42
7.0.210.0120.00317.39
7.0.200.0040.00817.22
7.0.190.0070.00717.34
7.0.180.0000.01117.37
7.0.170.0060.00917.32
7.0.160.0080.00817.27
7.0.150.0070.01017.17
7.0.140.0100.00717.28
7.0.130.0110.00417.19
7.0.120.0000.01017.41
7.0.110.0070.00717.33
7.0.100.0060.00317.40
7.0.90.0030.00917.36
7.0.80.0030.00617.21
7.0.70.0030.00917.32
7.0.60.0090.00617.09
7.0.50.0000.01417.14
7.0.40.0090.00315.40
7.0.30.0030.00615.28
7.0.20.0030.01015.34
7.0.10.0090.00615.27
7.0.00.0030.00615.31
5.6.400.0130.00016.19
5.6.390.0000.00916.32
5.6.380.0060.01316.21
5.6.370.0060.00916.25
5.6.360.0050.00516.00
5.6.350.0120.00416.03
5.6.340.0040.01116.21
5.6.330.0060.00915.89
5.6.320.0030.01015.96
5.6.310.0120.00616.36
5.6.300.0100.00716.14
5.6.290.0070.00716.08
5.6.280.0080.00316.35
5.6.270.0040.01116.39
5.6.260.0040.01016.15
5.6.250.0040.01116.10
5.6.240.0070.01016.19
5.6.230.0060.00616.20
5.6.220.0030.01016.12
5.6.210.0050.00816.00
5.6.200.0000.01016.34
5.6.190.0060.00616.18
5.6.180.0070.00416.37
5.6.170.0060.00616.20
5.6.160.0040.00716.04
5.6.150.0060.00616.27
5.6.140.0060.00616.26
5.6.130.0030.01416.04
5.6.120.0070.01016.30
5.6.110.0080.00316.13
5.6.100.0110.00716.32
5.6.90.0040.01216.32
5.6.80.0040.00415.92
5.6.70.0060.01016.06
5.6.60.0110.00416.17
5.6.50.0100.00715.95
5.6.40.0080.00616.09
5.6.30.0030.00916.09
5.6.20.0060.00916.09
5.6.10.0100.00716.16
5.6.00.0060.00915.88

preferences:
30.57 ms | 403 KiB | 5 Q