3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = '<?xml version="1.0" encoding="utf-8"?> <root total="450" count="4" start="0"> <Code>0</Code> <Item><Person.P_Id>14845</Person.P_Id></Item> <Item><Person.P_Id>14844</Person.P_Id></Item> <Item><Person.P_Id>14837</Person.P_Id></Item> <Item><Person.P_Id>14836</Person.P_Id></Item> </root>'; $xml = simplexml_load_string($xmlstr); $itemobjs = $xml->xpath('//Item'); print_r($itemobjs); $items = array_map(function ($v) { return (string)$v->{'Person.P_Id'}; }, $itemobjs); print_r($items);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => SimpleXMLElement Object ( [Person.P_Id] => 14845 ) [1] => SimpleXMLElement Object ( [Person.P_Id] => 14844 ) [2] => SimpleXMLElement Object ( [Person.P_Id] => 14837 ) [3] => SimpleXMLElement Object ( [Person.P_Id] => 14836 ) ) Array ( [0] => 14845 [1] => 14844 [2] => 14837 [3] => 14836 )

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