3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $root = $doc->appendChild($doc->createElement('root')); $root->setAttribute('xmlns:foo', 'uri:foo'); var_dump($root->hasAttribute('xmlns:foo'), $root->getAttribute('xmlns:foo')); foreach ($root->attributes as $k => $attribute) { var_dump($attribute->nodeName, $attribute->nodeValue); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 35
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 35
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/8viZo
function name:  (null)
number of ops:  37
compiled vars:  !0 = $doc, !1 = $root, !2 = $attribute, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    4     3        INIT_METHOD_CALL                                         !0, 'appendChild'
          4        INIT_METHOD_CALL                                         !0, 'createElement'
          5        SEND_VAL_EX                                              'root'
          6        DO_FCALL                                      0  $7      
          7        SEND_VAR_NO_REF_EX                                       $7
          8        DO_FCALL                                      0  $8      
          9        ASSIGN                                                   !1, $8
    5    10        INIT_METHOD_CALL                                         !1, 'setAttribute'
         11        SEND_VAL_EX                                              'xmlns%3Afoo'
         12        SEND_VAL_EX                                              'uri%3Afoo'
         13        DO_FCALL                                      0          
    7    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !1, 'hasAttribute'
         16        SEND_VAL_EX                                              'xmlns%3Afoo'
         17        DO_FCALL                                      0  $11     
         18        SEND_VAR                                                 $11
         19        INIT_METHOD_CALL                                         !1, 'getAttribute'
         20        SEND_VAL_EX                                              'xmlns%3Afoo'
         21        DO_FCALL                                      0  $12     
         22        SEND_VAR                                                 $12
         23        DO_ICALL                                                 
    9    24        FETCH_OBJ_R                                      ~14     !1, 'attributes'
         25      > FE_RESET_R                                       $15     ~14, ->35
         26    > > FE_FETCH_R                                       ~16     $15, !2, ->35
         27    >   ASSIGN                                                   !3, ~16
   10    28        INIT_FCALL                                               'var_dump'
         29        FETCH_OBJ_R                                      ~18     !2, 'nodeName'
         30        SEND_VAL                                                 ~18
         31        FETCH_OBJ_R                                      ~19     !2, 'nodeValue'
         32        SEND_VAL                                                 ~19
         33        DO_ICALL                                                 
    9    34      > JMP                                                      ->26
         35    >   FE_FREE                                                  $15
   11    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.46 ms | 1011 KiB | 14 Q