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"]; if($lg == '' || $lg == 'FI') { echo $child->getName().':'. $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/sPvbA
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 = 26
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 26
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 = 25
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 25
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 25
Branch analysis from position: 25
Branch analysis from position: 9
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/sPvbA
function name:  parseXML
number of ops:  28
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, ->26
          2    > > FE_FETCH_R                                               $3, !1, ->26
    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, ->25
   11    10    >   INIT_METHOD_CALL                                         !1, 'getName'
         11        DO_FCALL                                      0  $8      
         12        CONCAT                                           ~9      $8, '%3A'
         13        CONCAT                                           ~10     ~9, !1
         14        CONCAT                                           ~11     ~10, '%3Cbr%3E'
         15        ECHO                                                     ~11
   12    16        INIT_METHOD_CALL                                         !1, 'count'
         17        DO_FCALL                                      0  $12     
         18        IS_SMALLER                                               0, $12
         19      > JMPZ                                                     ~13, ->25
   14    20    >   INIT_FCALL_BY_NAME                                       'parseXML'
         21        INIT_METHOD_CALL                                         !1, 'children'
         22        DO_FCALL                                      0  $14     
         23        SEND_VAR_NO_REF_EX                                       $14
         24        DO_FCALL                                      0          
    8    25    > > JMP                                                      ->2
         26    >   FE_FREE                                                  $3
   18    27      > RETURN                                                   null

End of function parsexml

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.46 ms | 1400 KiB | 15 Q