3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Test extends DOMElement { public function __destruct() { var_dump(1); } } $dom = new DOMDocument; $dom->loadXML('<p>hi</p>'); $dom->firstChild->appendChild(new Test('a')); var_dump(2); var_dump($dom->saveHTML()); var_dump($dom->firstChild->firstChild->nextSibling);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsNuQ
function name:  (null)
number of ops:  28
compiled vars:  !0 = $dom
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   NEW                                                  $1      'DOMDocument'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   10     3        INIT_METHOD_CALL                                             !0, 'loadXML'
          4        SEND_VAL_EX                                                  '%3Cp%3Ehi%3C%2Fp%3E'
          5        DO_FCALL                                          0          
   11     6        FETCH_OBJ_R                                          ~5      !0, 'firstChild'
          7        INIT_METHOD_CALL                                             ~5, 'appendChild'
          8        NEW                                                  $6      'Test'
          9        SEND_VAL_EX                                                  'a'
         10        DO_FCALL                                          0          
         11        SEND_VAR_NO_REF_EX                                           $6
         12        DO_FCALL                                          0          
   12    13        INIT_FCALL                                                   'var_dump'
         14        SEND_VAL                                                     2
         15        DO_ICALL                                                     
   13    16        INIT_FCALL                                                   'var_dump'
         17        INIT_METHOD_CALL                                             !0, 'saveHTML'
         18        DO_FCALL                                          0  $10     
         19        SEND_VAR                                                     $10
         20        DO_ICALL                                                     
   15    21        INIT_FCALL                                                   'var_dump'
         22        FETCH_OBJ_R                                          ~12     !0, 'firstChild'
         23        FETCH_OBJ_R                                          ~13     ~12, 'firstChild'
         24        FETCH_OBJ_R                                          ~14     ~13, 'nextSibling'
         25        SEND_VAL                                                     ~14
         26        DO_ICALL                                                     
         27      > RETURN                                                       1

Class Test:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsNuQ
function name:  __destruct
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                                   'var_dump'
          1        SEND_VAL                                                     1
          2        DO_ICALL                                                     
    6     3      > RETURN                                                       null

End of function __destruct

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
195.96 ms | 1869 KiB | 14 Q