3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Document extends DOMDocument { } function foo() { $document = new Document(); var_dump(spl_object_hash($document)); $document->registerNodeClass("DOMDocument", "Document"); $element = $document->appendChild($document->createElement('div')); var_dump($element->ownerDocument instanceOf Document); return $element; } $element = foo(); var_dump($element->ownerDocument instanceOf Document, spl_object_hash($element->ownerDocument));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8a6Pd
function name:  (null)
number of ops:  14
compiled vars:  !0 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'foo'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
   16     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~3      !0, 'ownerDocument'
          5        INSTANCEOF                                       ~4      ~3, 'Document'
          6        SEND_VAL                                                 ~4
          7        INIT_FCALL                                               'spl_object_hash'
          8        FETCH_OBJ_R                                      ~5      !0, 'ownerDocument'
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                         $6      
         11        SEND_VAR                                                 $6
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8a6Pd
function name:  foo
number of ops:  27
compiled vars:  !0 = $document, !1 = $element
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $2      'Document'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    8     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'spl_object_hash'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                                 
    9     9        INIT_METHOD_CALL                                         !0, 'registerNodeClass'
         10        SEND_VAL_EX                                              'DOMDocument'
         11        SEND_VAL_EX                                              'Document'
         12        DO_FCALL                                      0          
   10    13        INIT_METHOD_CALL                                         !0, 'appendChild'
         14        INIT_METHOD_CALL                                         !0, 'createElement'
         15        SEND_VAL_EX                                              'div'
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR_NO_REF_EX                                       $8
         18        DO_FCALL                                      0  $9      
         19        ASSIGN                                                   !1, $9
   11    20        INIT_FCALL                                               'var_dump'
         21        FETCH_OBJ_R                                      ~11     !1, 'ownerDocument'
         22        INSTANCEOF                                       ~12     ~11, 'Document'
         23        SEND_VAL                                                 ~12
         24        DO_ICALL                                                 
   12    25      > RETURN                                                   !1
   13    26*     > RETURN                                                   null

End of function foo

Class Document: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.4 ms | 1403 KiB | 18 Q