3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml=simplexml_load_string(<<<XML <?xml version="1.0"?> <root> <Services> <Service> <ServiceCode>Route ID</ServiceCode> <RegisteredOperatorRef>Agency ID</RegisteredOperatorRef> <LineName>Route Short Name</LineName> <Description>Route Description</Description> <Mode>Route Type</Mode> </Service> </Services> </root> XML ); $api=array ( 'route_id' => array('Services', 'Service', 'ServiceCode'), 'agency_id' => array('Services', 'Service', 'RegisteredOperatorRef'), 'route_short_name' => array('Services', 'Service', 'LineName'), 'route_desc' => array('Services', 'Service', 'Description'), 'route_type' => array('Services', 'Service', 'Mode') ); function findText($entry,array $api,SimpleXMLElement $xml) { if(!empty($api[$entry])) { $cache=$xml; foreach($api[$entry] as $node) { $cache=$cache->{$node}; } return (String)$cache; } else { return null; } } echo findText("route_id",$api,$xml);
Output for git.master, git.master_jit, rfc.property-hooks
Route ID

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:
49.76 ms | 401 KiB | 8 Q