3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <searchRetrieveResponse xmlns="http://www.loc.gov/zing/srw/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/zing/srw/ srw-types.xsd"> <version>1.2</version> <numberOfRecords>23</numberOfRecords> <records> <record> <recordSchema>http://standaarden.overheid.nl/sru/</recordSchema> <recordPacking>xml</recordPacking> <recordData> <gzd xmlns="http://standaarden.overheid.nl/sru" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:overheid="http://standaarden.overheid.nl/owms/terms/" xmlns:overheidrg="http://standaarden.overheid.nl/cvdr/terms/" xsi:schemaLocation="http://standaarden.overheid.nl/sru gzd.xsd"> <originalData> <overheidrg:meta> <owmskern> <dcterms:identifier>123431_2</dcterms:identifier> <dcterms:title>Ligplaatsenverordening 2009</dcterms:title> <dcterms:language>nl</dcterms:language> <dcterms:type scheme="overheid:Informatietype">regeling</dcterms:type> <dcterms:creator scheme="overheid:Gemeente">Muiden</dcterms:creator> <dcterms:modified>2015-08-27</dcterms:modified> </owmskern> <owmsmantel> <dcterms:isFormatOf resourceIdentifier="">Onbekend</dcterms:isFormatOf> <dcterms:alternative>Ligplaatsenverordening 2009</dcterms:alternative> <dcterms:source resourceIdentifier="">artikel 149 van de Gemeentewet</dcterms:source> <dcterms:isRatifiedBy scheme="overheid:BestuursorgaanGemeente">gemeenteraad</dcterms:isRatifiedBy> <dcterms:subject>ruimtelijke ordening, verkeer en vervoer</dcterms:subject> <dcterms:issued>2012-12-20</dcterms:issued> </owmsmantel> <cvdripm> <overheidrg:inwerkingtredingDatum>2013-01-01</overheidrg:inwerkingtredingDatum> <overheidrg:uitwerkingtredingDatum /> <overheidrg:betreft>Onbekend</overheidrg:betreft> <overheidrg:kenmerk>Onbekend</overheidrg:kenmerk> <overheidrg:onderwerp /> <overheidrg:gedelegeerdeRegelgeving>&lt;al &gt;Geen&lt;/al&gt;</overheidrg:gedelegeerdeRegelgeving> <overheidrg:redactioneleToevoeging>&lt;al &gt;Geen&lt;/al&gt;</overheidrg:redactioneleToevoeging> </cvdripm> </overheidrg:meta> </originalData> <enrichedData> <organisatietype>Gemeente</organisatietype> <publicatieurl_xhtml>http://decentrale.regelgeving.overheid.nl/cvdr/xhtmloutput/Historie/Muiden/123431/123431_2.html</publicatieurl_xhtml> <publicatieurl_xml>http://decentrale.regelgeving.overheid.nl/cvdr/xmloutput/Historie/Muiden/123431/123431_2.xml</publicatieurl_xml> </enrichedData> </gzd> </recordData> <recordPosition>1</recordPosition> </record> </records> </searchRetrieveResponse> XML; $xml = new SimpleXMLElement($xml); $ns = $xml->getNamespaces(true); $xml->registerXPathNamespace('overheidrg', $ns['overheidrg']); $xmlRecords = $xml->xpath('//overheidrg:*'); // Loop the array which is returned from xpath which will contain all the SimpleXMLElement's from the 'overheidrg' // namespace like <overheidrg:meta> and <overheidrg:inwerkingtredingDatum> foreach ($xmlRecords as $record) { // Loop the children for those SimpleXMLElement's foreach ($record->children() as $recordChild) { // Get the children using the namespace 'dcterms' $children = $recordChild->children($ns['dcterms']); // Check for the name of the xml element if ($recordChild->getName() === "owmskern") { $identifier = $children->identifier->__toString(); $title = $children->title->__toString(); $language = $children->language->__toString(); $type = $children->type->__toString(); $creator = $children->creator->__toString(); $modified = $children->modified->__toString(); var_dump($identifier, $title, $language, $type, $creator, $modified); } if ($recordChild->getName() === "owmsmantel") { $isFormatOf = $children->isFormatOf->__toString(); $alternative = $children->alternative->__toString(); $source = $children->source->__toString(); $isRatifiedBy = $children->isRatifiedBy->__toString(); $subject = $children->subject->__toString(); $issued = $children->issued->__toString(); var_dump($isFormatOf, $alternative, $source, $isRatifiedBy, $subject, $isFormatOf); } } }

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)
7.0.00.0130.08720.07
5.6.160.0070.04020.44
5.6.150.0070.08018.19
5.6.140.0030.05318.25
5.6.130.0070.07018.29
5.6.120.0170.08021.12
5.6.110.0100.04720.98
5.6.100.0070.07320.99
5.6.90.0070.05021.10
5.6.80.0000.08020.46
5.5.300.0070.06717.92
5.5.290.0230.05018.08
5.5.280.0100.09020.78
5.5.270.0100.03320.76
5.5.260.0170.07320.76
5.5.250.0030.08720.61
5.5.240.0270.07720.25

preferences:
145.1 ms | 1386 KiB | 7 Q