3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<< HTML <html> <head> <title>A Simple HTML Document</title> </head> <body> <p>This is a very simple HTML document</p> <p>It only has two paragraphs</p> </body> </html> HTML; $dom = new DomDocument; $dom->loadHtml($html); listAllNodes($dom); function listAllNodes(DomNode $node) { echo "{$node->nodeName}\n"; foreach ($node->childNodes ?: [] as $node) { listAllNodes($node); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NbSgG
function name:  (null)
number of ops:  11
compiled vars:  !0 = $html, !1 = $dom
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Chtml%3E%0A%3Chead%3E%0A++%3Ctitle%3EA+Simple+HTML+Document%3C%2Ftitle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A++%3Cp%3EThis+is+a+very+simple+HTML+document%3C%2Fp%3E%0A++%3Cp%3EIt+only+has+two+paragraphs%3C%2Fp%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   15     1        NEW                                              $3      'DomDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   16     4        INIT_METHOD_CALL                                         !1, 'loadHtml'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   18     7        INIT_FCALL_BY_NAME                                       'listAllNodes'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
   25    10      > RETURN                                                   1

Function listallnodes:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 14
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/NbSgG
function name:  listAllNodes
number of ops:  16
compiled vars:  !0 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        FETCH_OBJ_R                                      ~1      !0, 'nodeName'
          2        NOP                                                      
          3        FAST_CONCAT                                      ~2      ~1, '%0A'
          4        ECHO                                                     ~2
   22     5        FETCH_OBJ_R                                      ~3      !0, 'childNodes'
          6        JMP_SET                                          ~4      ~3, ->8
          7        QM_ASSIGN                                        ~4      <array>
          8      > FE_RESET_R                                       $5      ~4, ->14
          9    > > FE_FETCH_R                                               $5, !0, ->14
   23    10    >   INIT_FCALL_BY_NAME                                       'listAllNodes'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   22    13      > JMP                                                      ->9
         14    >   FE_FREE                                                  $5
   25    15      > RETURN                                                   null

End of function listallnodes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.9 ms | 1395 KiB | 13 Q