3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = 'This should be extracted <p>I do not want this</p> This should also be extracted <a>This may appear after other tags and I do not want this</a>'; $doc = new DOMDocument(); $doc->loadHTML("<div>$html</div>", LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); $xpath = new DOMXPath($doc); $texts = array(); foreach ($xpath->query('/div/text()') as $text) { $texts[] = $text->nodeValue; } print_r($texts);

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.70.0110.00417.13
8.3.60.0110.00718.58
8.3.50.0150.00016.88
8.3.40.0120.00319.00
8.3.30.0070.01019.09
8.3.20.0080.00020.98
8.3.10.0040.00423.90
8.3.00.0070.00023.90
8.2.190.0130.00717.00
8.2.180.0120.00618.54
8.2.170.0130.00319.32
8.2.160.0100.00322.96
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00420.95
8.2.120.0080.00026.35
8.2.110.0100.00022.49
8.2.100.0080.00418.22
8.2.90.0040.00418.13
8.2.80.0050.00319.11
8.2.70.0060.00317.88
8.2.60.0000.00818.30
8.2.50.0090.00018.07
8.2.40.0030.00518.54
8.2.30.0040.00418.52
8.2.20.0040.00418.40
8.2.10.0060.00219.40
8.2.00.0060.00419.58
8.1.280.0060.01225.92
8.1.270.0080.00019.13
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0190.00019.55
8.1.230.0070.00717.95
8.1.220.0090.00018.03
8.1.210.0040.00418.77
8.1.200.0030.00617.60
8.1.190.0060.00317.60
8.1.180.0040.00418.10
8.1.170.0030.00619.09
8.1.160.0060.00319.16
8.1.150.0040.00419.16
8.1.140.0030.00520.89
8.1.130.0050.00519.00
8.1.120.0060.00618.26
8.1.110.0060.00618.79
8.1.100.0040.00718.83
8.1.90.0050.00718.75
8.1.80.0080.00518.75
8.1.70.0080.00418.74
8.1.60.0090.00318.89
8.1.50.0080.00418.85
8.1.40.0060.00818.84
8.1.30.0050.00819.00
8.1.20.0050.00818.34
8.1.10.0080.00518.87
8.1.00.0080.00318.19
8.0.300.0050.00518.77
8.0.290.0000.00716.88
8.0.280.0030.00318.78
8.0.270.0090.00018.36
8.0.260.0040.00618.59
8.0.250.0040.00518.13
8.0.240.0040.00418.20
8.0.230.0030.00618.17
8.0.220.0060.00318.08
8.0.210.0090.00217.54
8.0.200.0100.00117.55
8.0.190.0060.00517.55
8.0.180.0060.00517.53
8.0.170.0070.00517.55
8.0.160.0030.00717.52
8.0.150.0020.00617.50
8.0.140.0060.00417.55
8.0.130.0050.00316.36
8.0.120.0040.00817.45
8.0.110.0060.00518.08
8.0.100.0040.00718.01
8.0.90.0050.00518.08
8.0.80.0100.00518.10
8.0.70.0080.00317.52
8.0.60.0070.00217.52
8.0.50.0040.00617.56
8.0.30.0090.00717.37
8.0.20.0090.00517.72
8.0.10.0040.01017.89
8.0.00.0090.00717.68
7.4.330.0040.00416.83
7.4.320.0140.00117.29
7.4.300.0090.00717.28
7.4.290.0120.00217.29
7.4.280.0090.00617.29
7.4.270.0090.00517.35
7.4.260.0100.00317.30
7.4.250.0090.00517.32
7.4.240.0100.00417.35
7.4.230.0120.00317.24
7.4.220.0070.00717.34
7.4.210.0080.01017.20
7.4.200.0070.00517.29
7.4.190.0120.00317.63
7.4.180.0100.00417.54
7.4.160.0120.00517.12
7.4.150.0100.00717.13
7.4.140.0080.00817.48
7.4.130.0070.00916.99
7.4.120.0080.01017.06
7.4.110.0070.00817.01
7.4.100.0130.00417.06
7.4.90.0090.00817.04
7.4.80.0070.00917.43
7.4.70.0080.00717.04
7.4.60.0090.00617.00
7.4.50.0100.00616.99
7.4.40.0070.00916.94
7.4.30.0080.00916.96
7.4.20.0110.00616.95
7.4.10.0100.00516.97
7.4.00.0090.00616.72
7.3.330.0070.00416.09
7.3.320.0110.00116.05
7.3.310.0080.00417.07
7.3.300.0060.00617.15
7.3.290.0090.00317.14
7.3.280.0100.00716.79
7.3.270.0090.00716.92
7.3.260.0100.00616.76
7.3.250.0090.00516.94
7.3.240.0110.00516.81
7.3.230.0080.00716.86
7.3.220.0100.00516.85
7.3.210.0070.00916.83
7.3.200.0070.00816.80
7.3.190.0090.00716.86
7.3.180.0070.00716.77
7.3.170.0090.00816.80
7.3.160.0070.01016.83
7.3.150.0110.00516.92
7.3.140.0080.00816.88
7.3.130.0100.00716.75
7.3.120.0100.00516.81
7.3.110.0080.00716.72
7.3.100.0100.00616.76
7.3.90.0080.00716.97
7.3.80.0080.00716.81
7.3.70.0090.00716.96
7.3.60.0100.00516.90
7.3.50.0070.00716.96
7.3.40.0120.00516.95
7.3.30.0070.00716.96
7.3.20.0110.00617.17
7.3.10.0110.00517.11
7.3.00.0420.00516.51
7.2.340.0170.00816.97
7.2.330.0150.00616.96
7.2.320.0140.00616.99
7.2.310.0170.00517.03
7.2.300.0190.00617.01
7.2.290.0150.00816.97
7.2.280.0190.00717.02
7.2.270.0150.00717.02
7.2.260.0120.00817.00
7.2.250.0190.00417.03
7.2.240.0150.00617.03
7.2.230.0140.00716.97
7.2.220.0110.01017.02
7.2.210.0160.00816.96
7.2.200.0160.00517.12
7.2.190.0130.00817.06
7.2.180.0140.00717.05
7.2.170.0170.00517.14
7.2.160.0150.00817.08
7.2.150.0160.00717.41
7.2.140.0180.00517.42
7.2.130.0150.00817.22
7.2.120.0140.01017.12
7.2.110.0200.00517.13
7.2.100.0180.00717.13
7.2.90.0180.00917.06
7.2.80.0180.00817.12
7.2.70.0190.00817.08
7.2.60.0180.00817.13
7.2.50.0200.00817.08
7.2.40.0190.00817.11
7.2.30.0190.00717.11
7.2.20.0150.00917.14
7.2.10.0240.00417.15
7.2.00.0160.00817.13
7.1.330.0150.00516.36
7.1.320.0220.00316.33
7.1.310.0190.00816.33
7.1.300.0160.00816.33
7.1.290.0260.00516.34
7.1.280.0160.00616.33
7.1.270.0160.00516.31
7.1.260.0180.00716.33
7.1.250.0370.00815.94
7.1.240.0170.00916.25
7.1.230.0140.00616.30
7.1.220.0130.00816.23
7.1.210.0140.00916.33
7.1.200.0140.00716.29
7.1.190.0170.00616.27
7.1.180.0170.00716.27
7.1.170.0220.00516.29
7.1.160.0210.00816.25
7.1.150.0190.00816.26
7.1.140.0140.00816.24
7.1.130.0140.00716.27
7.1.120.0180.00716.23
7.1.110.0150.00816.27
7.1.100.0170.00616.30
7.1.90.0170.00616.22
7.1.80.0200.00916.25
7.1.70.0210.00616.11
7.1.60.0170.00616.30
7.1.50.0150.00816.27
7.1.40.0160.00716.31
7.1.30.0180.00516.33
7.1.20.0160.00816.32
7.1.10.0180.00816.22
7.1.00.0160.00716.19
7.0.330.0200.00515.68
7.0.320.0140.00716.05
7.0.310.0160.00516.02
7.0.300.0240.00416.05
7.0.290.0170.00716.00
7.0.280.0140.00616.04
7.0.270.0150.00616.06
7.0.260.0120.00916.07
7.0.250.0150.00716.21
7.0.240.0140.00816.22
7.0.230.0220.00616.12
7.0.220.0180.00516.09
7.0.210.0140.00716.09
7.0.200.0150.00616.11
7.0.190.0150.00616.11
7.0.180.0140.00816.15
7.0.170.0150.00816.19
7.0.160.0170.00615.98
7.0.150.0180.00516.02
7.0.140.0150.00716.11
7.0.130.0170.00416.08
7.0.120.0190.00716.14
7.0.110.0190.00516.06
7.0.100.0180.00516.08
7.0.90.0240.00916.01
7.0.80.0180.00715.97
7.0.70.0140.00716.00
7.0.60.0130.00916.02
7.0.50.0150.00715.98
7.0.40.0150.00816.09
7.0.30.0160.00516.07
7.0.20.0150.00716.02
7.0.10.0140.00816.00
7.0.00.0140.00716.00
5.6.400.0120.00916.57
5.6.390.0140.00916.52
5.6.380.0140.00716.26
5.6.370.0150.00616.53
5.6.360.0180.00516.59
5.6.350.0130.00816.58
5.6.340.0140.00816.59
5.6.330.0130.00916.60
5.6.320.0150.00716.58
5.6.310.0150.00716.58
5.6.300.0170.00516.38
5.6.290.0160.00616.57
5.6.280.0160.00716.58
5.6.270.0170.00616.51
5.6.260.0130.01016.59
5.6.250.0150.00816.66
5.6.240.0130.00816.71
5.6.230.0140.00916.69
5.6.220.0160.01016.67
5.6.210.0150.00816.64
5.6.200.0160.00616.64
5.6.190.0140.00816.69
5.6.180.0130.01216.64
5.6.170.0160.00716.70
5.6.160.0140.00816.71
5.6.150.0160.00616.72
5.6.140.0150.00816.68
5.6.130.0140.00816.67
5.6.120.0140.00816.64
5.6.110.0170.00816.68
5.6.100.0170.00416.68
5.6.90.0110.01216.57
5.6.80.0130.00916.53
5.6.70.0130.00916.64
5.6.60.0120.00816.57
5.6.50.0140.00816.52
5.6.40.0130.00816.63
5.6.30.0160.00516.60
5.6.20.0170.00616.49
5.6.10.0150.00716.56
5.6.00.0130.00916.53

preferences:
68.43 ms | 401 KiB | 5 Q