3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <products> <product> <name>Final Fantasy VII</name> <desc>Den Rollenspiel-Klassiker FINAL FANTASY VII gibt es jetzt für den PC, mit brandneuen Online-Features!</desc> <price>11.69</price> <price_base>12.99</price_base> <link>https://de.steam.com/game/final-fantasy-vii-download--1001-1</link> <publisher>Eidos - Square Enix</publisher> <category>RPG (Rollenspiel)</category> <ean/> <packshot>https://de.gamesplanet.com/acache/10/01/1/de/packshot-770bf6d03800b87dc0f9509f21e8d423.jpg</packshot> </product> <product> <name>Final Fantasy VII</name> <desc>Den Rollenspiel-Klassiker FINAL FANTASY VII gibt es jetzt für den PC, mit brandneuen Online-Features!</desc> <price>11.69</price> <price_base>12.99</price_base> <link>https://de.gamesplanet.com/game/final-fantasy-vii-download--1001-1</link> <publisher>Eidos - Square Enix</publisher> <category>RPG (Rollenspiel)</category> <ean/> <packshot>https://de.gamesplanet.com/acache/10/01/1/de/packshot-770bf6d03800b87dc0f9509f21e8d423.jpg</packshot> </product> <product> <name>Final Fantasy VII</name> <desc>Den Rollenspiel-Klassiker steam FINAL FANTASY VII gibt es jetzt für den PC, mit brandneuen Online-Features!</desc> <price>11.69</price> <price_base>12.99</price_base> <link>https://de.gamesplanet.com/game/final-fantasy-vii-download--1001-1</link> <publisher>Eidos - Square Enix</publisher> <category>RPG (Rollenspiel)</category> <ean/> <packshot>https://de.gamesplanet.com/acache/10/01/1/de/packshot-770bf6d03800b87dc0f9509f21e8d423.jpg</packshot> </product> </products> XML; $gamesplanetPath = 'data/gamesplanet.xml'; $kinguinPath = 'data/kinguin.xml'; $onlinekeystorePath = 'data/onlinekeystore.xml'; $g2aPath = 'data/g2a.xml'; function countAd($xml){ $dom = new DOMDocument('1.0', 'utf-8'); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; $dom->loadXML($xml); $counter = 0; $root = $dom->documentElement; $marker = $root->getElementsByTagName('name'); for($i = $marker->length - 1; $i >= 0 ; $i--){ $counter = $counter + 1 ; } echo "Products: " . $counter ."\n"; } countAd($xml);
Output for git.master, git.master_jit, rfc.property-hooks
Products: 3

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
30.62 ms | 405 KiB | 5 Q