3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadXml('<html xmlns:f="foo"><body f:bar="bar"></body></html>'); var_dump((boolean) $dom->getElementsByTagName('head')->length ? '<head> available' : '<head> not available'); var_dump((boolean) $dom->getElementsByTagName('body')->length ? '<body> available' : '<body> not available'); foreach ($dom->getElementsByTagName('body')->item(0)->attributes as $attr) { var_dump($attr->namespaceURI.'#'.$attr->nodeName); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
2 jumps found. (Code = 78) Position 1 = 39, Position 2 = 47
Branch analysis from position: 39
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 38, Position 2 = 47
Branch analysis from position: 38
Branch analysis from position: 47
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
Branch analysis from position: 27
filename:       /in/gtkIW
function name:  (null)
number of ops:  49
compiled vars:  !0 = $dom, !1 = $attr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    4     3        INIT_METHOD_CALL                                         !0, 'loadXml'
          4        SEND_VAL_EX                                              '%3Chtml+xmlns%3Af%3D%22foo%22%3E%3Cbody+f%3Abar%3D%22bar%22%3E%3C%2Fbody%3E%3C%2Fhtml%3E'
          5        DO_FCALL                                      0          
    6     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'head'
          9        DO_FCALL                                      0  $6      
         10        FETCH_OBJ_R                                      ~7      $6, 'length'
         11        BOOL                                             ~8      ~7
         12      > JMPZ                                                     ~8, ->15
         13    >   QM_ASSIGN                                        ~9      '%3Chead%3E+available'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~9      '%3Chead%3E+not+available'
         16    >   SEND_VAL                                                 ~9
         17        DO_ICALL                                                 
    7    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
         20        SEND_VAL_EX                                              'body'
         21        DO_FCALL                                      0  $11     
         22        FETCH_OBJ_R                                      ~12     $11, 'length'
         23        BOOL                                             ~13     ~12
         24      > JMPZ                                                     ~13, ->27
         25    >   QM_ASSIGN                                        ~14     '%3Cbody%3E+available'
         26      > JMP                                                      ->28
         27    >   QM_ASSIGN                                        ~14     '%3Cbody%3E+not+available'
         28    >   SEND_VAL                                                 ~14
         29        DO_ICALL                                                 
    8    30        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
         31        SEND_VAL_EX                                              'body'
         32        DO_FCALL                                      0  $16     
         33        INIT_METHOD_CALL                                         $16, 'item'
         34        SEND_VAL_EX                                              0
         35        DO_FCALL                                      0  $17     
         36        FETCH_OBJ_R                                      ~18     $17, 'attributes'
         37      > FE_RESET_R                                       $19     ~18, ->47
         38    > > FE_FETCH_R                                               $19, !1, ->47
    9    39    >   INIT_FCALL                                               'var_dump'
         40        FETCH_OBJ_R                                      ~20     !1, 'namespaceURI'
         41        CONCAT                                           ~21     ~20, '%23'
         42        FETCH_OBJ_R                                      ~22     !1, 'nodeName'
         43        CONCAT                                           ~23     ~21, ~22
         44        SEND_VAL                                                 ~23
         45        DO_ICALL                                                 
    8    46      > JMP                                                      ->38
         47    >   FE_FREE                                                  $19
   10    48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.23 ms | 1400 KiB | 15 Q