3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = ' <!doctype html> <html> <head> <title>Test Page</title> <meta charset="utf-8" /> </head> <body> <p>One two three four five six</p> </body> </html>'; $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $query = $xpath->query("/html/body"); $body = $dom->saveXML($query->item(0)); $body = strip_tags($body); echo end(explode('three four', $body));

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.00817.13
8.3.50.0110.01117.70
8.3.40.0040.01119.21
8.3.30.0080.00818.95
8.3.20.0040.00419.12
8.3.10.0030.00620.91
8.3.00.0080.00019.63
8.2.180.0110.00717.25
8.2.170.0080.00822.96
8.2.160.0070.00720.90
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00419.75
8.2.110.0030.00721.61
8.2.100.0120.00018.28
8.2.90.0030.00621.57
8.2.80.0080.00019.64
8.2.70.0040.00417.88
8.2.60.0000.00818.28
8.2.50.0000.00818.07
8.2.40.0000.00918.53
8.2.30.0050.00518.39
8.2.20.0050.00318.09
8.2.10.0000.00818.01
8.2.00.0030.00618.13
8.1.280.0120.00325.92
8.1.270.0040.00424.66
8.1.260.0050.00326.35
8.1.250.0110.00728.09
8.1.240.0000.00924.22
8.1.230.0040.00721.26
8.1.220.0060.00318.24
8.1.210.0040.00419.33
8.1.200.0050.00517.72
8.1.190.0050.00318.04
8.1.180.0080.00018.10
8.1.170.0000.00819.37
8.1.160.0040.00419.25
8.1.150.0000.00819.02
8.1.140.0030.00517.82
8.1.130.0050.00218.15
8.1.120.0000.00817.82
8.1.110.0050.00217.82
8.1.100.0030.00617.75
8.1.90.0000.01117.90
8.1.80.0040.00417.89
8.1.70.0040.00417.92
8.1.60.0060.00318.02
8.1.50.0040.00417.94
8.1.40.0050.00317.81
8.1.30.0040.00418.10
8.1.20.0000.00817.99
8.1.10.0000.00817.96
8.1.00.0000.00817.89
8.0.300.0040.00420.48
8.0.290.0000.00717.25
8.0.280.0030.00318.88
8.0.270.0080.00017.63
8.0.260.0000.00717.31
8.0.250.0040.00417.50
8.0.240.0030.00517.38
8.0.230.0000.00717.41
8.0.220.0000.00617.29
8.0.210.0000.00717.32
8.0.200.0030.00317.45
8.0.190.0000.00817.25
8.0.180.0050.00317.40
8.0.170.0000.00817.41
8.0.160.0040.00417.20
8.0.150.0080.00017.35
8.0.140.0000.00717.23
8.0.130.0030.00313.81
8.0.120.0070.00017.30
8.0.110.0050.00317.48
8.0.100.0070.00017.43
8.0.90.0000.00717.32
8.0.80.0100.00717.38
8.0.70.0030.00517.25
8.0.60.0000.00817.37
8.0.50.0040.00417.38
8.0.30.0080.01117.40
8.0.20.0130.00617.60
8.0.10.0050.00217.52
8.0.00.0080.01217.22
7.4.330.0020.00213.39
7.4.320.0040.00416.95
7.4.300.0040.00417.07
7.4.290.0030.00316.84
7.4.280.0080.00016.92
7.4.270.0040.00417.04
7.4.260.0000.00613.69
7.4.250.0030.00616.84
7.4.240.0030.00316.93
7.4.230.0000.00716.98
7.4.220.0110.01116.84
7.4.210.0080.00716.97
7.4.200.0070.00016.89
7.4.190.0050.00316.99
7.4.160.0070.01416.73
7.4.150.0140.00416.79
7.4.140.0040.01416.94
7.4.130.0110.00616.76
7.4.120.0070.01416.89
7.4.110.0060.01316.85
7.4.100.0070.01116.93
7.4.90.0070.01017.04
7.4.80.0080.01016.92
7.4.70.0060.01217.03
7.4.60.0140.01116.84
7.4.50.0000.00516.64
7.4.40.0030.01316.76
7.4.30.0130.00316.92
7.4.00.0070.01115.13
7.3.330.0030.00313.63
7.3.320.0050.00013.61
7.3.310.0000.00816.80
7.3.300.0030.00316.54
7.3.290.0050.01016.71
7.3.280.0050.01216.72
7.3.270.0140.00316.73
7.3.260.0070.01216.82
7.3.250.0100.01016.73
7.3.240.0100.00716.93
7.3.230.0090.00916.92
7.3.210.0150.00316.86
7.3.200.0130.00719.39
7.3.190.0150.00716.77
7.3.180.0120.00916.77
7.3.170.0140.00316.95
7.3.160.0060.00916.74
7.3.120.0040.00715.21
7.2.330.0030.01316.91
7.2.320.0100.01017.17
7.2.310.0150.00917.02
7.2.300.0080.00916.88
7.2.290.0060.00916.95
7.2.60.0000.01217.16
7.2.00.0030.00919.59
7.1.200.0120.00316.13
7.1.100.0000.01418.21
7.1.70.0040.00417.01
7.1.60.0110.01119.40
7.1.50.0090.01517.26
7.1.00.0070.07322.63
7.0.200.0070.00017.13
7.0.140.0070.07022.20
7.0.120.0070.07022.22
7.0.60.0130.05020.16
7.0.50.0070.04317.93
7.0.40.0100.05720.19
7.0.30.0330.06020.27
7.0.20.0200.04720.14
7.0.10.0130.07720.18
7.0.00.0030.04320.37
5.6.280.0030.07321.14
5.6.210.0130.08020.85
5.6.200.0130.07718.36
5.6.190.0030.09320.58
5.6.180.0230.08020.54
5.6.170.0230.06020.69
5.6.160.0070.08020.51
5.6.150.0030.04718.29
5.6.140.0070.06318.31
5.6.130.0070.05318.28
5.6.120.0070.08321.16
5.6.110.0100.08721.12
5.6.100.0170.04021.20
5.6.90.0130.06721.14
5.6.80.0070.07320.61
5.5.350.0300.07320.47
5.5.340.0100.03718.07
5.5.330.0200.05320.36
5.5.320.0200.05320.47
5.5.310.0270.04320.48
5.5.300.0100.04318.14
5.5.290.0000.06318.11
5.5.280.0230.06020.91
5.5.270.0130.08020.90
5.5.260.0030.06020.85
5.5.250.0130.07320.72
5.5.240.0000.05720.26
5.4.450.0000.04019.64
5.4.440.0000.05019.42
5.4.430.0030.04719.32
5.4.420.0070.04019.71
5.4.410.0070.04719.52
5.4.400.0030.03719.00
5.4.390.0030.05019.13
5.4.380.0030.08019.23
5.4.370.0000.08019.16
5.4.360.0070.04319.16
5.4.350.0100.03319.00
5.4.340.0130.07019.27
5.4.320.0100.04018.96
5.4.310.0030.04018.94
5.4.300.0030.04019.23
5.4.290.0070.03319.00
5.4.280.0000.05019.14
5.4.270.0100.07019.32
5.4.260.0070.05719.29
5.4.250.0130.06019.25
5.4.240.0070.04719.22
5.4.230.0030.08018.95
5.4.220.0070.03719.12
5.4.210.0100.04319.32
5.4.200.0070.05719.26
5.4.190.0100.07319.32
5.4.180.0130.05019.28
5.4.170.0130.06718.98
5.4.160.0070.07718.94
5.4.150.0070.05318.98
5.4.140.0070.03716.44
5.4.130.0030.05016.54
5.4.120.0100.06316.55
5.4.110.0000.05016.49
5.4.100.0100.07016.47
5.4.90.0100.05016.50
5.4.80.0100.06716.50
5.4.70.0100.07016.42
5.4.60.0000.08316.49
5.4.50.0030.03716.47
5.4.40.0070.07316.60
5.4.30.0070.07316.37
5.4.20.0130.03016.41
5.4.10.0000.05716.51
5.4.00.0130.07015.89
5.3.290.0070.05014.76
5.3.280.0070.08314.68
5.3.270.0070.05014.71
5.3.260.0070.07014.70
5.3.250.0000.04314.70
5.3.240.0170.07014.63
5.3.230.0000.05314.69
5.3.220.0070.08014.68
5.3.210.0070.06314.70
5.3.200.0070.03314.80
5.3.190.0070.08014.75
5.3.180.0030.05014.73
5.3.170.0130.05314.61
5.3.160.0100.07314.73
5.3.150.0030.04314.71
5.3.140.0070.05014.66
5.3.130.0070.07714.57
5.3.120.0030.04314.68
5.3.110.0130.06714.62
5.3.100.0070.05714.16
5.3.90.0070.07714.11
5.3.80.0100.04014.12
5.3.70.0070.05714.26
5.3.60.0030.04313.97
5.3.50.0030.03714.10
5.3.40.0070.08014.08
5.3.30.0030.07314.15
5.3.20.0100.05713.78
5.3.10.0070.05713.78
5.3.00.0070.07013.72
5.2.170.0000.06711.23
5.2.160.0070.06311.27
5.2.150.0000.04311.21
5.2.140.0030.04011.29
5.2.130.0000.04011.18
5.2.120.0030.06711.19
5.2.110.0030.03311.19
5.2.100.0000.05311.23
5.2.90.0070.02711.15
5.2.80.0100.05011.18
5.2.70.0030.03011.12
5.2.60.0000.04011.11
5.2.50.0070.02711.14
5.2.40.0070.02711.07
5.2.30.0000.03311.05
5.2.20.0200.02011.17
5.2.10.0000.06311.06
5.2.00.0000.04710.86
5.1.60.0030.03010.16
5.1.50.0030.02710.17
5.1.40.0030.03010.13
5.1.30.0070.04310.63
5.1.20.0070.03010.54
5.1.10.0070.03310.20
5.1.00.0000.03010.21
5.0.50.0000.0208.84
5.0.40.0000.0208.59
5.0.30.0030.0278.41
5.0.20.0030.0278.33
5.0.10.0030.0338.39
5.0.00.0000.0538.35
4.4.90.0030.0177.50
4.4.80.0000.0177.50
4.4.70.0070.0277.50
4.4.60.0000.0237.50
4.4.50.0030.0237.50
4.4.40.0000.0377.50
4.4.30.0000.0177.50
4.4.20.0000.0207.50
4.4.10.0070.0137.50
4.4.00.0000.0237.50
4.3.110.0030.0137.50
4.3.100.0000.0207.50
4.3.90.0030.0337.50
4.3.80.0000.0477.50
4.3.70.0000.0207.50
4.3.60.0030.0277.50
4.3.50.0030.0277.50
4.3.40.0030.0307.50
4.3.30.0030.0377.50
4.3.20.0000.0307.50
4.3.10.0000.0277.50
4.3.00.0070.0277.50

preferences:
35.6 ms | 401 KiB | 5 Q