3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <sizes> <size label="Square" width="75" height="75" /> <size label="Thumbnail" width="100" height="62" /> <size label="Small" width="112" height="69">small</size> <size label="Large" width="112" height="69">large</size> </sizes> XML; $xml = simplexml_load_string($string); $result = $xml->xpath("//size"); // print the first (and only) member of the array var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> object(SimpleXMLElement)#2 (1) { ["@attributes"]=> array(3) { ["label"]=> string(6) "Square" ["width"]=> string(2) "75" ["height"]=> string(2) "75" } } [1]=> object(SimpleXMLElement)#3 (1) { ["@attributes"]=> array(3) { ["label"]=> string(9) "Thumbnail" ["width"]=> string(3) "100" ["height"]=> string(2) "62" } } [2]=> object(SimpleXMLElement)#4 (2) { ["@attributes"]=> array(3) { ["label"]=> string(5) "Small" ["width"]=> string(3) "112" ["height"]=> string(2) "69" } [0]=> string(5) "small" } [3]=> object(SimpleXMLElement)#5 (2) { ["@attributes"]=> array(3) { ["label"]=> string(5) "Large" ["width"]=> string(3) "112" ["height"]=> string(2) "69" } [0]=> string(5) "large" } }

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:
54.06 ms | 403 KiB | 8 Q