3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <reference:reference xmlns:seller="http://services.mobile.de/schema/seller" xmlns:ad="http://services.mobile.de/schema/ad" xmlns:financing="http://services.mobile.de/schema/common/financing-1.0" xmlns:reference="http://services.mobile.de/schema/reference" xmlns:resource="http://services.mobile.de/schema/resource"> <reference:item key="Cabrio" url="https://services.mobile.de/refdata/classes/Car/categories/Cabrio"> <resource:local-description xml-lang="en">Cabriolet / Roadster</resource:local-description> </reference:item> <reference:item key="EstateCar" url="https://services.mobile.de/refdata/classes/Car/categories/EstateCar"> <resource:local-description xml-lang="en">Estate Car</resource:local-description> </reference:item> <reference:item key="Limousine" url="https://services.mobile.de/refdata/classes/Car/categories/Limousine"> <resource:local-description xml-lang="en">Saloon</resource:local-description> </reference:item> <reference:item key="OffRoad" url="https://services.mobile.de/refdata/classes/Car/categories/OffRoad"> <resource:local-description xml-lang="en">SUV/Off-road Vehicle/Pickup Truck</resource:local-description> </reference:item> <reference:item key="SmallCar" url="https://services.mobile.de/refdata/classes/Car/categories/SmallCar"> <resource:local-description xml-lang="en">Small Car</resource:local-description> </reference:item> <reference:item key="SportsCar" url="https://services.mobile.de/refdata/classes/Car/categories/SportsCar"> <resource:local-description xml-lang="en">Sports Car/Coupe</resource:local-description> </reference:item> <reference:item key="Van" url="https://services.mobile.de/refdata/classes/Car/categories/Van"> <resource:local-description xml-lang="en">Van/Minibus</resource:local-description> </reference:item> <reference:item key="OtherCar" url="https://services.mobile.de/refdata/classes/Car/categories/OtherCar"> <resource:local-description xml-lang="en">Other</resource:local-description> </reference:item> </reference:reference> DATA; $xml = simplexml_load_string($data); foreach($xml->xpath("/reference:reference/reference:item") as $item) { $key = (string)$item->attributes()["key"]; $description = (string)$item->xpath("./resource:local-description")[0]; echo "Key: " . $key . PHP_EOL; echo "Description " . $description . PHP_EOL; echo PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
Key: Cabrio Description Cabriolet / Roadster Key: EstateCar Description Estate Car Key: Limousine Description Saloon Key: OffRoad Description SUV/Off-road Vehicle/Pickup Truck Key: SmallCar Description Small Car Key: SportsCar Description Sports Car/Coupe Key: Van Description Van/Minibus Key: OtherCar Description Other

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:
123.98 ms | 406 KiB | 5 Q