3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyElement extends DOMElement { } $dom = new DOMDocument(); $e = new MyElement("e"); $dom->appendChild($e); // Gives MyElement echo get_class($dom->childNodes->item(0)) . "\n"; $e = null; // Gives DOMElement echo get_class($dom->childNodes->item(0)) . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/57MFQ
function name:  (null)
number of ops:  26
compiled vars:  !0 = $dom, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   NEW                                              $2      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    5     3        NEW                                              $5      'MyElement'
          4        SEND_VAL_EX                                              'e'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    6     7        INIT_METHOD_CALL                                         !0, 'appendChild'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
    8    10        FETCH_OBJ_R                                      ~9      !0, 'childNodes'
         11        INIT_METHOD_CALL                                         ~9, 'item'
         12        SEND_VAL_EX                                              0
         13        DO_FCALL                                      0  $10     
         14        GET_CLASS                                        ~11     $10
         15        CONCAT                                           ~12     ~11, '%0A'
         16        ECHO                                                     ~12
    9    17        ASSIGN                                                   !1, null
   12    18        FETCH_OBJ_R                                      ~14     !0, 'childNodes'
         19        INIT_METHOD_CALL                                         ~14, 'item'
         20        SEND_VAL_EX                                              0
         21        DO_FCALL                                      0  $15     
         22        GET_CLASS                                        ~16     $15
         23        CONCAT                                           ~17     ~16, '%0A'
         24        ECHO                                                     ~17
         25      > RETURN                                                   1

Class MyElement: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.7 ms | 1394 KiB | 13 Q