3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $doc->loadXML('just <example a="b">Test</example> testing'); $example = $doc->getElementsByTagName('example')->item(0); //$attr = $example->getAttributeNode('a'); foreach($example->attributes as $attr) var_dump($attr->name); var_dump($attr->name);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/75M1Z
function name:  (null)
number of ops:  27
compiled vars:  !0 = $doc, !1 = $example, !2 = $attr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    4     3        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              'just+%3Cexample+a%3D%22b%22%3ETest%3C%2Fexample%3E+testing'
          5        DO_FCALL                                      0          
    6     6        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          7        SEND_VAL_EX                                              'example'
          8        DO_FCALL                                      0  $7      
          9        INIT_METHOD_CALL                                         $7, 'item'
         10        SEND_VAL_EX                                              0
         11        DO_FCALL                                      0  $8      
         12        ASSIGN                                                   !1, $8
    8    13        FETCH_OBJ_R                                      ~10     !1, 'attributes'
         14      > FE_RESET_R                                       $11     ~10, ->21
         15    > > FE_FETCH_R                                               $11, !2, ->21
         16    >   INIT_FCALL                                               'var_dump'
         17        FETCH_OBJ_R                                      ~12     !2, 'name'
         18        SEND_VAL                                                 ~12
         19        DO_ICALL                                                 
         20      > JMP                                                      ->15
         21    >   FE_FREE                                                  $11
    9    22        INIT_FCALL                                               'var_dump'
         23        FETCH_OBJ_R                                      ~14     !2, 'name'
         24        SEND_VAL                                                 ~14
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.82 ms | 1395 KiB | 15 Q