3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = <<<BUFFER <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> <channel> <title><![CDATA[Title]]></title> <link><![CDATA[https:/path/]]></link> <description>WooCommerce Product List RSS feed</description> <metadata> <ref_application_id>451257172939091</ref_application_id> </metadata> <item> <g:id>anID</g:id> <g:inventory>5</g:inventory> <g:description><![CDATA[Some Text]]></g:description> <g:condition>new</g:condition> <g:mpn>sku</g:mpn> <g:title>Product Title</g:title> <g:availability>in stock</g:availability> <g:price>184.00 EUR</g:price> <g:brand><![CDATA[BRAND1]]></g:brand> </item> <item> <g:id>anID</g:id> <g:inventory>5</g:inventory> <g:description><![CDATA[Some Text]]></g:description> <g:condition>new</g:condition> <g:mpn>sku</g:mpn> <g:title>Product Title</g:title> <g:availability>in stock</g:availability> <g:price>185.00 EUR</g:price> <g:brand><![CDATA[BRAND2]]></g:brand> </item> <item> <g:id>anID</g:id> <g:inventory>5</g:inventory> <g:description><![CDATA[Some Text]]></g:description> <g:condition>new</g:condition> <g:mpn>sku</g:mpn> <g:title>Product Title</g:title> <g:availability>in stock</g:availability> <g:price>186.00 EUR</g:price> <g:brand><![CDATA[BRAND2]]></g:brand> </item> <!-- ............ --> </channel> </rss> BUFFER; $xmlobj = new SimpleXMLElement($xmlstr); foreach ($xmlobj->xpath('//item[g:brand="BRAND2"]') as $item) { unset($item[0]); } //Format XML to save indented tree rather than one line and save $dom = new DOMDocument('1.0'); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; $dom->loadXML($xmlobj->asXML()); $dom->save('php://output');

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.5.10.0100.00917.15
8.5.00.0060.01620.48
8.4.160.0140.00824.41
8.4.150.0030.00014.05
8.4.140.0150.00717.89
8.4.130.0150.00718.02
8.4.120.0040.00421.14
8.4.110.0130.00819.18
8.4.100.0140.00719.00
8.4.90.0100.01020.93
8.4.80.0080.00619.24
8.4.70.0080.00619.35
8.4.60.0090.01319.29
8.4.50.0120.01019.02
8.4.40.0160.00319.78
8.4.30.0130.00720.71
8.4.20.0200.00021.00
8.4.10.0160.00318.07
8.3.280.0150.00718.88
8.3.270.0080.00117.04
8.3.260.0140.00917.09
8.3.250.0130.00719.39
8.3.240.0140.00619.34
8.3.230.0120.00717.35
8.3.220.0110.00819.60
8.3.210.0120.00717.25
8.3.200.0150.00517.11
8.3.190.0080.00717.38
8.3.180.0100.01019.74
8.3.170.0130.00317.41
8.3.160.0100.01017.69
8.3.150.0090.00917.64
8.3.140.0080.00019.38
8.3.130.0060.00616.92
8.3.120.0040.00421.07
8.3.110.0060.00320.94
8.3.100.0130.00324.06
8.3.90.0100.00026.77
8.3.80.0080.00318.81
8.3.70.0090.00617.25
8.3.60.0160.00317.00
8.3.50.0130.00718.41
8.3.40.0060.00919.13
8.3.30.0070.00719.27
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0130.00519.65
8.2.280.0100.00918.88
8.2.270.0120.00417.15
8.2.260.0040.01417.17
8.2.250.0060.00317.05
8.2.240.0070.00317.77
8.2.230.0120.00422.58
8.2.220.0050.00537.54
8.2.210.0050.01026.77
8.2.200.0060.00616.75
8.2.190.0150.00617.13
8.2.180.0040.01225.92
8.2.170.0070.01419.41
8.2.160.0140.00022.96
8.2.150.0050.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.17
8.2.110.0040.00820.85
8.2.100.0060.00618.16
8.2.90.0100.00018.13
8.2.80.0030.00619.25
8.2.70.0080.00017.88
8.2.60.0060.00318.00
8.2.50.0060.00618.13
8.2.40.0040.00819.98
8.2.30.0040.00418.25
8.2.20.0000.00818.47
8.2.10.0020.00519.71
8.2.00.0000.00719.76
8.1.330.0150.00516.48
8.1.320.0100.00918.48
8.1.310.0120.00316.37
8.1.300.0030.00520.84
8.1.290.0040.00430.84
8.1.280.0070.00725.92
8.1.270.0080.00024.32
8.1.260.0060.00326.35
8.1.250.0080.00028.09
8.1.240.0060.00319.43
8.1.230.0000.01218.20
8.1.220.0050.00318.28
8.1.210.0040.00418.77
8.1.200.0060.00317.97
8.1.190.0000.00817.85
8.1.180.0060.00318.10
8.1.170.0000.00919.09
8.1.160.0090.00023.03
8.1.150.0000.00819.03
8.1.140.0040.00419.33
8.1.130.0100.00020.64
8.1.120.0000.00717.75
8.1.110.0000.00917.94
8.1.100.0080.00017.95
8.1.90.0000.01117.83
8.1.80.0060.00317.88
8.1.70.0000.00717.95
8.1.60.0030.00517.90
8.1.50.0030.00618.05
8.1.40.0060.00317.89
8.1.30.0040.00418.15
8.1.20.0040.00418.19
8.1.10.0000.00818.04
8.1.00.0040.00417.93
8.0.300.0030.00518.99
8.0.290.0000.00717.25
8.0.280.0000.00818.37
8.0.270.0040.00417.20
8.0.260.0030.00318.96
8.0.250.0000.00717.50
8.0.240.0040.00417.50
8.0.230.0040.00417.50
8.0.220.0070.00017.17
8.0.210.0000.00717.26
8.0.200.0060.00017.28
8.0.190.0080.00417.43
8.0.180.0000.00717.25
8.0.170.0040.00417.32
8.0.160.0000.01017.21
8.0.150.0020.00517.13
8.0.140.0040.00417.19
8.0.130.0000.00613.69
8.0.120.0040.00417.28
8.0.110.0040.00417.16
8.0.100.0040.00417.33
8.0.90.0080.00017.30
8.0.80.0080.00017.14
8.0.70.0030.00517.28
8.0.60.0070.00017.39
8.0.50.0000.00717.37
8.0.30.0000.00717.36
8.0.20.0040.00417.41
8.0.10.0030.00517.41
8.0.00.0040.00417.46
7.4.330.0000.00515.55
7.4.320.0030.00317.02
7.4.300.0040.00416.87
7.4.290.0040.00416.89
7.4.280.0000.00916.97
7.4.270.0000.00716.99
7.4.260.0030.00513.69
7.4.250.0000.00816.71
7.4.240.0050.00217.00
7.4.230.0000.00716.76
7.4.220.0000.00816.97
7.4.210.0030.00316.90
7.4.200.0080.00017.07
7.4.190.0040.00417.13
7.4.180.0040.00417.06
7.4.160.0030.00517.02
7.4.150.0030.00316.78
7.4.140.0030.00316.89
7.4.130.0040.00416.66
7.4.120.0000.00816.89
7.4.110.0050.00316.73
7.4.100.0040.00417.05
7.4.90.0030.00516.80
7.4.80.0000.00716.77
7.4.70.0040.00416.89
7.4.60.0000.00816.86
7.4.50.0030.00516.80
7.4.40.0080.00016.82
7.4.30.0000.00816.71
7.4.20.0040.00416.85
7.4.10.0070.00016.98
7.4.00.0080.00017.04
7.3.330.0040.00416.53
7.3.320.0000.00513.67
7.3.310.0000.00716.69
7.3.300.0030.00316.76
7.3.290.0030.00516.77
7.3.280.0040.00416.65
7.3.270.0000.00716.69
7.3.260.0000.00716.85
7.3.250.0070.00016.80
7.3.240.0050.00216.68
7.3.230.0030.00316.79
7.3.220.0000.00816.77
7.3.210.0030.00516.61
7.3.200.0030.00316.56
7.3.190.0000.00716.60
7.3.180.0000.00816.77
7.3.170.0080.00016.77
7.3.160.0070.00016.66
7.3.150.0070.00016.73
7.3.140.0000.00716.62
7.3.130.0000.00616.62
7.3.120.0030.00316.76
7.3.110.0030.00316.62
7.3.100.0000.00716.55
7.3.90.0030.00317.06
7.3.80.0030.00316.55
7.3.70.0030.00316.82
7.3.60.0030.00316.88
7.3.50.0000.00716.74
7.3.40.0030.00316.79
7.3.30.0030.00516.88
7.3.20.0040.00416.98
7.3.10.0030.00616.73
7.3.00.0040.00416.84
5.5.380.0130.00318.44

preferences:
34.37 ms | 403 KiB | 5 Q