3v4l.org

run code in 500+ PHP versions simultaneously
<?php $doc = new DOMDocument("1.0"); $node = $doc->createElement("foo"); $newnode = $doc->appendChild($node); $newnode->setAttribute("bar", "baz"); var_dump($newnode->getAttribute('bar')); var_dump(method_exists($newnode, 'getAttribute')); var_dump(get_class($newnode));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/chZ0Y
function name:  (null)
number of ops:  34
compiled vars:  !0 = $doc, !1 = $node, !2 = $newnode
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $3      'DOMDocument'
          1        SEND_VAL_EX                                                  '1.0'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $3
    4     4        INIT_METHOD_CALL                                             !0, 'createElement'
          5        SEND_VAL_EX                                                  'foo'
          6        DO_FCALL                                          0  $6      
          7        ASSIGN                                                       !1, $6
    5     8        INIT_METHOD_CALL                                             !0, 'appendChild'
          9        SEND_VAR_EX                                                  !1
         10        DO_FCALL                                          0  $8      
         11        ASSIGN                                                       !2, $8
    6    12        INIT_METHOD_CALL                                             !2, 'setAttribute'
         13        SEND_VAL_EX                                                  'bar'
         14        SEND_VAL_EX                                                  'baz'
         15        DO_FCALL                                          0          
    7    16        INIT_FCALL                                                   'var_dump'
         17        INIT_METHOD_CALL                                             !2, 'getAttribute'
         18        SEND_VAL_EX                                                  'bar'
         19        DO_FCALL                                          0  $11     
         20        SEND_VAR                                                     $11
         21        DO_ICALL                                                     
    8    22        INIT_FCALL                                                   'var_dump'
         23        INIT_FCALL                                                   'method_exists'
         24        SEND_VAR                                                     !2
         25        SEND_VAL                                                     'getAttribute'
         26        DO_ICALL                                             $13     
         27        SEND_VAR                                                     $13
         28        DO_ICALL                                                     
    9    29        INIT_FCALL                                                   'var_dump'
         30        GET_CLASS                                            ~15     !2
         31        SEND_VAL                                                     ~15
         32        DO_ICALL                                                     
         33      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
165.44 ms | 2061 KiB | 15 Q