3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = '<?xml version="1.0" encoding="ISO-8859-1" ?> <Servicos> <cServico> <Codigo>40010</Codigo> </cServico> </Servicos>'; $b = '<?xml version="1.0" encoding="ISO-8859-1" ?> <Servicos> <cServico> <Codigo>40010</Codigo> </cServico> <cServico> <Codigo>40011</Codigo> </cServico> </Servicos>'; function getCodes(SimpleXMLElement $xml) { $codes = array(); foreach ($xml->cServico as $item) { $codes[] = (string)$item->Codigo; } return $codes; } var_dump(getCodes(new SimpleXMLElement($a))); var_dump(getCodes(new SimpleXMLElement($b)));
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [0]=> string(5) "40010" } array(2) { [0]=> string(5) "40010" [1]=> string(5) "40011" }

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