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/S7npX
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 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/S7npX
function name:  listAllNodes
number of ops:  14
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      > FE_RESET_R                                       $4      ~3, ->12
          7    > > FE_FETCH_R                                               $4, !0, ->12
   23     8    >   INIT_FCALL_BY_NAME                                       'listAllNodes'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   22    11      > JMP                                                      ->7
         12    >   FE_FREE                                                  $4
   25    13      > RETURN                                                   null

End of function listallnodes

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.51 ms | 1395 KiB | 13 Q