3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml=simplexml_load_string(<<<XML <?xml version="1.0"?> <root> <element> <feed id="9"> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> <feed id="10"> <title>test</title> <table>feeds</table> <link/> <feed_type>API</feed_type> <affiliate/> <mwst>ja</mwst> <tld>DE</tld> <query/> </feed> </element> </root> XML ); $target = $xml->xpath('//feed[@id="10"]'); if(!$target){ echo "wrong xpath" } $domRef = dom_import_simplexml($target[0]); $domRef -> parentNode -> removeChild($domRef); $dom = new DOMDocument('1.0'); $dom -> preserveWhiteSpace = false; $dom ->formatOutput = true; $dom -> loadXML($xml->asXML()); echo $xml->asXML();

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)
5.4.310.0070.04112.50
5.4.300.0100.04112.50
5.4.290.0070.04112.50
5.4.280.0050.04512.39
5.4.270.0040.04612.39
5.4.260.0060.03812.39
5.4.250.0080.03912.39
5.4.240.0090.03712.39
5.4.230.0040.04712.38
5.4.220.0060.03812.39
5.4.210.0080.04012.38
5.4.200.0040.04612.39
5.4.190.0100.03212.38
5.4.180.0070.04112.38
5.4.170.0090.03912.39
5.4.160.0050.04012.38
5.4.150.0100.03612.38
5.4.140.0090.04212.07
5.4.130.0060.03812.05
5.4.120.0050.03512.02
5.4.110.0100.03412.01
5.4.100.0030.04412.01
5.4.90.0030.04012.02
5.4.80.0060.04212.02
5.4.70.0080.03712.01
5.4.60.0060.03312.01
5.4.50.0070.04112.01
5.4.40.0090.03612.00
5.4.30.0090.03512.00
5.4.20.0030.04111.99
5.4.10.0080.03312.00
5.4.00.0060.04111.49
5.3.280.0100.03912.71
5.3.270.0080.04812.72
5.3.260.0110.04112.72
5.3.250.0090.04312.72
5.3.240.0080.03912.72
5.3.230.0070.04012.71
5.3.220.0070.04012.68
5.3.210.0090.04212.68
5.3.200.0080.04312.68
5.3.190.0070.04812.68
5.3.180.0060.03912.68
5.3.170.0010.04112.67
5.3.160.0100.04112.67
5.3.150.0090.04312.67
5.3.140.0040.03712.66
5.3.130.0050.04012.66
5.3.120.0040.04612.66
5.3.110.0060.04212.66
5.3.100.0070.04712.12
5.3.90.0080.04312.09
5.3.80.0070.03512.07
5.3.70.0090.03812.07
5.3.60.0050.03812.06
5.3.50.0060.04012.00
5.3.40.0060.04012.00
5.3.30.0070.04211.95
5.3.20.0060.04211.73
5.3.10.0070.03811.70
5.3.00.0080.03711.69
5.2.170.0090.0369.18
5.2.160.0110.0259.18
5.2.150.0030.0439.19
5.2.140.0080.0399.18
5.2.130.0080.0369.14
5.2.120.0120.0309.14
5.2.110.0070.0329.15
5.2.100.0030.0389.14
5.2.90.0050.0339.14
5.2.80.0060.0359.14
5.2.70.0090.0349.14
5.2.60.0090.0349.09
5.2.50.0040.0409.07
5.2.40.0070.0369.04
5.2.30.0050.0309.01
5.2.20.0060.0379.02
5.2.10.0060.0368.94
5.2.00.0090.0378.80
5.1.60.0070.0258.09
5.1.50.0080.0248.08
5.1.40.0020.0298.07
5.1.30.0060.0298.42
5.1.20.0040.0328.44
5.1.10.0080.0298.16
5.1.00.0080.0278.17
5.0.50.0050.0286.64
5.0.40.0020.0226.51
5.0.30.0060.0316.31
5.0.20.0040.0286.29
5.0.10.0040.0226.26
5.0.00.0020.0396.25
4.4.90.0030.0244.78
4.4.80.0060.0254.76
4.4.70.0040.0194.76
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0010.0344.70
4.4.30.0040.0204.76
4.4.20.0090.0124.84
4.4.10.0050.0184.85
4.4.00.0030.0274.76
4.3.110.0040.0184.66
4.3.100.0030.0204.66
4.3.90.0060.0144.64
4.3.80.0060.0244.58
4.3.70.0070.0154.63
4.3.60.0100.0174.63
4.3.50.0060.0274.63
4.3.40.0040.0304.54
4.3.30.0030.0203.30
4.3.20.0030.0233.29
4.3.10.0030.0193.23
4.3.00.0030.0206.82

preferences:
145.51 ms | 1386 KiB | 7 Q