3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <root> <a> <b> <id>123</id> <name>Daughter</name> <a> <b> <id>234</id> <name>Mom</name> <c>1</c> <a> <b> <id>345</id> <name>Grandma</name> </b> </a> </b> </a> </b> </a> </root> XML; $xml = simplexml_load_string($xml); foreach ($xml->xpath('//b') as $item) { echo $item->id . $item->name . PHP_EOL; } foreach ($xml->xpath('//name') as $name) { echo $name . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
123Daughter 234Mom 345Grandma Daughter Mom Grandma

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:
134.76 ms | 405 KiB | 5 Q