3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<node><element>hi</element></node>"; $dom = new DOMDocument(); $dom->loadXML($xml); $ele = $dom->getElementsByTagName('element')->item(0); echo get_class($ele)."\n"; echo get_parent_class($ele)."\n"; var_dump($ele instanceof DOMElement); var_dump($ele instanceof DOMNode);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hD8HB
function name:  (null)
number of ops:  31
compiled vars:  !0 = $xml, !1 = $dom, !2 = $ele
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Cnode%3E%3Celement%3Ehi%3C%2Felement%3E%3C%2Fnode%3E'
    4     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    6     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'element'
          9        DO_FCALL                                      0  $8      
         10        INIT_METHOD_CALL                                         $8, 'item'
         11        SEND_VAL_EX                                              0
         12        DO_FCALL                                      0  $9      
         13        ASSIGN                                                   !2, $9
   10    14        GET_CLASS                                        ~11     !2
         15        CONCAT                                           ~12     ~11, '%0A'
         16        ECHO                                                     ~12
   12    17        INIT_FCALL                                               'get_parent_class'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $13     
         20        CONCAT                                           ~14     $13, '%0A'
         21        ECHO                                                     ~14
   14    22        INIT_FCALL                                               'var_dump'
         23        INSTANCEOF                                       ~15     !2, 'DOMElement'
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                                 
   16    26        INIT_FCALL                                               'var_dump'
         27        INSTANCEOF                                       ~17     !2, 'DOMNode'
         28        SEND_VAL                                                 ~17
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.69 ms | 1400 KiB | 17 Q