3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<XML <?xml version="1.0" encoding="ISO-8859-1"?> <PersonList> <Header> </Header> <Person> <Name id="35">Sonu Kapoor</Name> <Age>24</Age> <Gender>M</Gender> <PostalCode>54879</PostalCode> </Person> <Person> <Name>Jasmin</Name> <Age>28</Age> <Gender>M</Gender> <PostalCode>78745</PostalCode> </Person> <Person> <Name>Josef</Name> <Age>232</Age> <Gender>F</Gender> <PostalCode>53454</PostalCode> </Person> </PersonList> XML; $doc = new DOMDocument(); $doc->loadXML($content); $xp = new DOMXPath($doc); foreach ($xPath->query('//PersonList/Person/Name') AS $Name) { $ID = $Name->getAttribute('id'); $Atrib = $Name->getAttribute('atrib'); if($Atrib != "") { $Name->Attribute('atrib') = "Nuevo"; } } $doc->formatOutput = true; echo $doc->saveXML();

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.250.0050.03912.34
5.4.240.0070.03612.34
5.4.230.0070.04112.33
5.4.220.0050.03612.33
5.4.210.0050.03512.33
5.4.200.0050.04112.33
5.4.190.0050.03812.33
5.4.180.0050.03812.33
5.4.170.0040.03812.34
5.4.160.0080.03812.33
5.4.150.0050.03612.33
5.4.140.0060.03612.01
5.4.130.0020.03712.00
5.4.120.0060.03811.96
5.4.110.0040.03911.96
5.4.100.0050.03711.95
5.4.90.0040.03811.95
5.4.80.0050.03811.95
5.4.70.0040.04111.95
5.4.60.0050.04311.95
5.4.50.0060.04211.95
5.4.40.0040.03611.94
5.4.30.0050.03511.93
5.4.20.0050.03511.93
5.4.10.0050.03411.93
5.4.00.0040.03811.43
5.3.280.0070.04012.71
5.3.270.0070.04112.72
5.3.260.0100.03412.72
5.3.250.0050.03812.72
5.3.240.0060.04712.72
5.3.230.0040.04012.71
5.3.220.0070.03612.68
5.3.210.0020.04212.68
5.3.200.0060.03612.68
5.3.190.0050.03812.68
5.3.180.0050.03912.67
5.3.170.0070.03512.67
5.3.160.0080.03512.67
5.3.150.0070.03912.67
5.3.140.0050.03812.66
5.3.130.0070.03912.66
5.3.120.0060.04212.66
5.3.110.0070.03812.66
5.3.100.0060.03612.12
5.3.90.0060.03912.08
5.3.80.0080.03612.07
5.3.70.0090.03912.07
5.3.60.0090.03612.06
5.3.50.0040.03812.00
5.3.40.0080.04112.00
5.3.30.0080.03911.95
5.3.20.0040.04311.71
5.3.10.0040.03811.68
5.3.00.0040.03811.66
5.2.170.0040.0319.16
5.2.160.0040.0309.16
5.2.150.0070.0319.16
5.2.140.0040.0319.16
5.2.130.0040.0309.12
5.2.120.0040.0299.12
5.2.110.0090.0329.13
5.2.100.0040.0299.13
5.2.90.0050.0299.13
5.2.80.0040.0319.12
5.2.70.0040.0319.12
5.2.60.0040.0309.07
5.2.50.0050.0299.04
5.2.40.0040.0299.02
5.2.30.0040.0308.99
5.2.20.0050.0349.01
5.2.10.0050.0308.93
5.2.00.0040.0328.78
5.1.60.0050.0238.07
5.1.50.0020.0278.07
5.1.40.0040.0258.06
5.1.30.0050.0268.40
5.1.20.0070.0258.43
5.1.10.0050.0288.15
5.1.00.0040.0288.15
5.0.50.0040.0196.63
5.0.40.0030.0206.48
5.0.30.0030.0326.30
5.0.20.0030.0216.27
5.0.10.0040.0216.25
5.0.00.0020.0326.24
4.4.90.0020.0164.78
4.4.80.0020.0154.76
4.4.70.0020.0164.76
4.4.60.0040.0154.75
4.4.50.0030.0154.77
4.4.40.0030.0254.71
4.4.30.0040.0224.76
4.4.20.0040.0164.85
4.4.10.0030.0184.85
4.4.00.0020.0254.76
4.3.110.0030.0194.67
4.3.100.0020.0164.66
4.3.90.0030.0164.63
4.3.80.0020.0274.59
4.3.70.0030.0144.63
4.3.60.0010.0174.63
4.3.50.0020.0164.63
4.3.40.0040.0254.54
4.3.30.0020.0153.31
4.3.20.0020.0163.29
4.3.10.0020.0223.23
4.3.00.0230.0206.72

preferences:
145.6 ms | 1394 KiB | 7 Q