3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml_string = '<?xml version="1.0" encoding="utf-8"?> <livraria> <livro categoria="cozinha"> <titulo lang="en">Everyday Italian</titulo> <autor>Giada De Laurentiis</autor> <ano>2005</ano> <preco>30.00</preco> </livro> <livro categoria="juvenil"> <titulo lang="pt">Harry Potter e o Cálice de Fogo</titulo> <autor>J. K. Rowling</autor> <ano>2005</ano> <preco>29.99</preco> </livro> <livro categoria="web"> <titulo lang="en">Learning XML</titulo> <autor>Erik T. Ray</autor> <ano>2003</ano> <preco>39.95</preco> </livro> <livro categoria="ficcao"> <titulo lang="pt">Guia do Mochileiro das Galáxias, O</titulo> <autor>Douglas Adams</autor> <ano>1979</ano> <preco>19.95</preco> </livro> </livraria>'; $livraria = new SimpleXMLElement($xml_string); ?> <?php foreach($livraria->children() as $livro) :?> <ul> <li> <?=$livro->getName()?> <?php foreach($livro->attributes() as $attr) :?> <ul> <li> <?=$attr->getName() . " : " . $attr ?> <ul> <?php foreach($livro->children() as $item) :?> <li><?=$item->getName() . " : " . $item ?></li> <?php endforeach; ?> </ul> </li> </ul> <?php endforeach; ?> </li> </ul> <?php endforeach; ?><?php
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 44
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 44
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 41
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 41
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 38
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 38
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 41
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
filename:       /in/5fCNt
function name:  (null)
number of ops:  46
compiled vars:  !0 = $xml_string, !1 = $livraria, !2 = $livro, !3 = $attr, !4 = $item
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0A%3Clivraria%3E%0A%3Clivro+categoria%3D%22cozinha%22%3E%0A%3Ctitulo+lang%3D%22en%22%3EEveryday+Italian%3C%2Ftitulo%3E%0A%3Cautor%3EGiada+De+Laurentiis%3C%2Fautor%3E%0A%3Cano%3E2005%3C%2Fano%3E%0A%3Cpreco%3E30.00%3C%2Fpreco%3E%0A%3C%2Flivro%3E%0A%3Clivro+categoria%3D%22juvenil%22%3E%0A%3Ctitulo+lang%3D%22pt%22%3EHarry+Potter+e+o+C%C3%A1lice+de+Fogo%3C%2Ftitulo%3E%0A%3Cautor%3EJ.+K.+Rowling%3C%2Fautor%3E%0A%3Cano%3E2005%3C%2Fano%3E%0A%3Cpreco%3E29.99%3C%2Fpreco%3E%0A%3C%2Flivro%3E%0A%3Clivro+categoria%3D%22web%22%3E%0A%3Ctitulo+lang%3D%22en%22%3ELearning+XML%3C%2Ftitulo%3E%0A%3Cautor%3EErik+T.+Ray%3C%2Fautor%3E%0A%3Cano%3E2003%3C%2Fano%3E%0A%3Cpreco%3E39.95%3C%2Fpreco%3E%0A%3C%2Flivro%3E%0A%3Clivro+categoria%3D%22ficcao%22%3E%0A%3Ctitulo+lang%3D%22pt%22%3EGuia+do+Mochileiro+das+Gal%C3%A1xias%2C+O%3C%2Ftitulo%3E%0A%3Cautor%3EDouglas+Adams%3C%2Fautor%3E%0A%3Cano%3E1979%3C%2Fano%3E%0A%3Cpreco%3E19.95%3C%2Fpreco%3E%0A%3C%2Flivro%3E%0A%3C%2Flivraria%3E'
   29     1        NEW                                              $6      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $6
   30     5        ECHO                                                     '%09%0A'
   31     6        INIT_METHOD_CALL                                         !1, 'children'
          7        DO_FCALL                                      0  $9      
          8      > FE_RESET_R                                       $10     $9, ->44
          9    > > FE_FETCH_R                                               $10, !2, ->44
   32    10    >   ECHO                                                     '%3Cul%3E%0A%3Cli%3E%0A%09%09'
   34    11        INIT_METHOD_CALL                                         !2, 'getName'
         12        DO_FCALL                                      0  $11     
         13        ECHO                                                     $11
   35    14        ECHO                                                     '++++%09%0A%09%09'
   36    15        INIT_METHOD_CALL                                         !2, 'attributes'
         16        DO_FCALL                                      0  $12     
         17      > FE_RESET_R                                       $13     $12, ->41
         18    > > FE_FETCH_R                                               $13, !3, ->41
   37    19    >   ECHO                                                     '++++++++%09%09%3Cul%3E%0A++++++++++++++++%09%3Cli%3E%0A++++++++++++++++++'
   39    20        INIT_METHOD_CALL                                         !3, 'getName'
         21        DO_FCALL                                      0  $14     
         22        CONCAT                                           ~15     $14, '+%3A+'
         23        CONCAT                                           ~16     ~15, !3
         24        ECHO                                                     ~16
   40    25        ECHO                                                     '++++++++++++++++++++++++%3Cul%3E%0A'
   41    26        INIT_METHOD_CALL                                         !2, 'children'
         27        DO_FCALL                                      0  $17     
         28      > FE_RESET_R                                       $18     $17, ->38
         29    > > FE_FETCH_R                                               $18, !4, ->38
   42    30    >   ECHO                                                     '%3Cli%3E'
         31        INIT_METHOD_CALL                                         !4, 'getName'
         32        DO_FCALL                                      0  $19     
         33        CONCAT                                           ~20     $19, '+%3A+'
         34        CONCAT                                           ~21     ~20, !4
         35        ECHO                                                     ~21
         36        ECHO                                                     '%3C%2Fli%3E%09%0A'
   41    37      > JMP                                                      ->29
         38    >   FE_FREE                                                  $18
   44    39        ECHO                                                     '%3C%2Ful%3E%0A%3C%2Fli%3E%0A%3C%2Ful%3E%0A'
   36    40      > JMP                                                      ->18
         41    >   FE_FREE                                                  $13
   48    42        ECHO                                                     '%3C%2Fli%3E%0A%3C%2Ful%3E%0A'
   31    43      > JMP                                                      ->9
         44    >   FE_FREE                                                  $10
   50    45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.06 ms | 1399 KiB | 13 Q