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>"); foreach($result->corretores->susep->children() as $a) echo $a; if (is_array($result->corretores->susep->children())){ 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()); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 34
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 31
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 31
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 30
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 31
Branch analysis from position: 31
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 42
Branch analysis from position: 40
Branch analysis from position: 42
Branch analysis from position: 12
Found catch point at position: 46
Branch analysis from position: 46
2 jumps found. (Code = 107) Position 1 = 47, Position 2 = -2
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NuM10
function name:  (null)
number of ops:  52
compiled vars:  !0 = $result, !1 = $a, !2 = $susep, !3 = $retorno, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'simplexml_load_string'
          1        SEND_VAL                                                 '%3Csegurado%3E%0A%3CnomeSegurado%3EEMERSON+DA+SILVA+BRULL%3C%2FnomeSegurado%3E%0A%3CnumeroCpfCnpj%3E345769118%3C%2FnumeroCpfCnpj%3E%0A%3CordemCnpj%3E0%3C%2FordemCnpj%3E%0A%3CdigitoCpfCnpj%3E56%3C%2FdigitoCpfCnpj%3E%0A%3CstatusSegurado%3E2%3C%2FstatusSegurado%3E%0A%3Ccorretores%3E%0A%3Csusep%3E%3C%2Fsusep%3E%0A%3Csusep%3EV2064F%3C%2Fsusep%3E%0A%3Csusep%3EP5005J%3C%2Fsusep%3E%0A%3Csusep%3EP2371J%3C%2Fsusep%3E%0A%3C%2Fcorretores%3E%0A%3C%2Fsegurado%3E'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
   19     4        FETCH_OBJ_R                                      ~7      !0, 'corretores'
          5        FETCH_OBJ_R                                      ~8      ~7, 'susep'
          6        INIT_METHOD_CALL                                         ~8, 'children'
          7        DO_FCALL                                      0  $9      
          8      > FE_RESET_R                                       $10     $9, ->12
          9    > > FE_FETCH_R                                               $10, !1, ->12
   20    10    >   ECHO                                                     !1
   19    11      > JMP                                                      ->9
         12    >   FE_FREE                                                  $10
   22    13        FETCH_OBJ_R                                      ~11     !0, 'corretores'
         14        FETCH_OBJ_R                                      ~12     ~11, 'susep'
         15        INIT_METHOD_CALL                                         ~12, 'children'
         16        DO_FCALL                                      0  $13     
         17        TYPE_CHECK                                  128          $13
         18      > JMPZ                                                     ~14, ->34
   24    19    >   FETCH_OBJ_R                                      ~15     !0, 'corretores'
         20        FETCH_OBJ_R                                      ~16     ~15, 'susep'
         21      > FE_RESET_R                                       $17     ~16, ->31
         22    > > FE_FETCH_R                                               $17, !2, ->31
   25    23    >   ECHO                                                     1
   26    24        INSTANCEOF                                       ~18     !2, 'Object'
         25        BOOL_NOT                                         ~19     ~18
         26      > JMPZ                                                     ~19, ->30
   27    27    >   ECHO                                                     2
   28    28        ASSIGN                                                   !3, !2
   29    29      > JMP                                                      ->31
   24    30    > > JMP                                                      ->22
         31    >   FE_FREE                                                  $17
   34    32        ASSIGN                                                   !3, null
         33      > JMP                                                      ->38
   37    34    >   ECHO                                                     0
   38    35        FETCH_OBJ_R                                      ~22     !0, 'corretores'
         36        FETCH_OBJ_R                                      ~23     ~22, 'susep'
         37        ASSIGN                                                   !3, ~23
   41    38    >   TYPE_CHECK                                    2          !3
         39      > JMPZ                                                     ~25, ->42
   42    40    >   ECHO                                                     'x'
   44    41        ASSIGN                                                   !3, ''
   47    42    >   INIT_FCALL                                               'var_dump'
         43        SEND_VAR                                                 !3
         44        DO_ICALL                                                 
         45      > JMP                                                      ->51
   49    46  E > > CATCH                                       last         'Exception'
   50    47    >   INIT_METHOD_CALL                                         !4, 'getMessage'
         48        DO_FCALL                                      0  $28     
         49        INIT_ARRAY                                       ~29     $28, 'erro'
         50      > RETURN                                                   ~29
   51    51    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.38 ms | 1400 KiB | 17 Q