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 $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/RMHds
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          
   18    10      > RETURN                                                   1

Function parsexml:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 22
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 22
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 = 21
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
Branch analysis from position: 21
Branch analysis from position: 9
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/RMHds
function name:  parseXML
number of ops:  24
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, ->22
          2    > > FE_FETCH_R                                               $3, !1, ->22
    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, ->21
   11    10    >   CONCAT                                           ~8      !1, '%3Cbr%3E'
         11        FREE                                                     ~8
   12    12        INIT_METHOD_CALL                                         !1, 'count'
         13        DO_FCALL                                      0  $9      
         14        IS_SMALLER                                               0, $9
         15      > JMPZ                                                     ~10, ->21
   14    16    >   INIT_FCALL_BY_NAME                                       'parseXML'
         17        INIT_METHOD_CALL                                         !1, 'children'
         18        DO_FCALL                                      0  $11     
         19        SEND_VAR_NO_REF_EX                                       $11
         20        DO_FCALL                                      0          
    8    21    > > JMP                                                      ->2
         22    >   FE_FREE                                                  $3
   18    23      > RETURN                                                   null

End of function parsexml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.33 ms | 1405 KiB | 15 Q