3v4l.org

run code in 300+ PHP versions simultaneously
<?php $filename = '<joku><NO_MARK LG="FI">9.<fi>Termos</fi></NO_MARK> <TI_MARK LG="ES">Budjetti<es>Hola</es></TI_MARK></joku>'; $xml_file = simplexml_load_string($filename); parseXML($xml_file->children()); function parseXML($xml_children) { foreach ($xml_children as $child){ $lg = $child["LG"];//LG-attribuutti if($lg == '' || $lg == 'FI') { //jos on annettu LG ja se on joku muu kuin FI, sivuutetaan if($child != '') { echo $child."<br>"; } if ($child->count() > 0) { parseXML($child->children()); } } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qWYvL
function name:  (null)
number of ops:  11
compiled vars:  !0 = $filename, !1 = $xml_file
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cjoku%3E%3CNO_MARK+LG%3D%22FI%22%3E9.%3Cfi%3ETermos%3C%2Ffi%3E%3C%2FNO_MARK%3E%0A%3CTI_MARK+LG%3D%22ES%22%3EBudjetti%3Ces%3EHola%3C%2Fes%3E%3C%2FTI_MARK%3E%3C%2Fjoku%3E'
    4     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
    5     5        INIT_FCALL_BY_NAME                                       'parseXML'
          6        INIT_METHOD_CALL                                         !1, 'children'
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR_NO_REF_EX                                       $5
          9        DO_FCALL                                      0          
   20    10      > RETURN                                                   1

Function parsexml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 24
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 24
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 23
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 23
Branch analysis from position: 14
Branch analysis from position: 23
Branch analysis from position: 9
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/qWYvL
function name:  parseXML
number of ops:  26
compiled vars:  !0 = $xml_children, !1 = $child, !2 = $lg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    8     1      > FE_RESET_R                                       $3      !0, ->24
          2    > > FE_FETCH_R                                               $3, !1, ->24
    9     3    >   FETCH_DIM_R                                      ~4      !1, 'LG'
          4        ASSIGN                                                   !2, ~4
   10     5        IS_EQUAL                                         ~6      !2, ''
          6      > JMPNZ_EX                                         ~6      ~6, ->9
          7    >   IS_EQUAL                                         ~7      !2, 'FI'
          8        BOOL                                             ~6      ~7
          9    > > JMPZ                                                     ~6, ->23
   11    10    >   IS_NOT_EQUAL                                             !1, ''
         11      > JMPZ                                                     ~8, ->14
   12    12    >   CONCAT                                           ~9      !1, '%3Cbr%3E'
         13        ECHO                                                     ~9
   14    14    >   INIT_METHOD_CALL                                         !1, 'count'
         15        DO_FCALL                                      0  $10     
         16        IS_SMALLER                                               0, $10
         17      > JMPZ                                                     ~11, ->23
   16    18    >   INIT_FCALL_BY_NAME                                       'parseXML'
         19        INIT_METHOD_CALL                                         !1, 'children'
         20        DO_FCALL                                      0  $12     
         21        SEND_VAR_NO_REF_EX                                       $12
         22        DO_FCALL                                      0          
    8    23    > > JMP                                                      ->2
         24    >   FE_FREE                                                  $3
   20    25      > RETURN                                                   null

End of function parsexml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.73 ms | 1392 KiB | 15 Q