3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { $result = simplexml_load_string("<segurado> <nomeSegurado>EMERSON DA SILVA BRULL</nomeSegurado> <numeroCpfCnpj>345769118</numeroCpfCnpj> <ordemCnpj>0</ordemCnpj> <digitoCpfCnpj>56</digitoCpfCnpj> <statusSegurado>2</statusSegurado> <corretores> <susep></susep> <susep>V2064F</susep> <susep>P5005J</susep> <susep>P2371J</susep> </corretores> </segurado>"); if (is_array($result->corretores->susep)){ foreach($result->corretores->susep as $susep) { echo 1; if( !($susep instanceof Object) ) { echo 2; $retorno = $susep; break; } } $retorno = null; } else { echo 0; $retorno = $result->corretores->susep; } if (is_null($retorno)){ echo 'x'; $retorno=''; } //registrarLog(0, 0, 'Retorno Webservice: ' . $retorno); var_dump($retorno); } catch (Exception $e) { return array("erro"=>$e->getMessage()); }
Output for git.master, git.master_jit, rfc.property-hooks
0object(SimpleXMLElement)#3 (0) { }

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