3v4l.org

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

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CmJTj
function name:  foo
number of ops:  21
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_METHOD_CALL                                         !0, 'registerNodeClass'
          4        SEND_VAL_EX                                              'DOMDocument'
          5        SEND_VAL_EX                                              'Document'
          6        DO_FCALL                                      0          
    9     7        INIT_METHOD_CALL                                         !0, 'appendChild'
          8        INIT_METHOD_CALL                                         !0, 'createElement'
          9        SEND_VAL_EX                                              'div'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR_NO_REF_EX                                       $6
         12        DO_FCALL                                      0  $7      
         13        ASSIGN                                                   !1, $7
   10    14        INIT_FCALL                                               'var_dump'
         15        FETCH_OBJ_R                                      ~9      !1, 'ownerDocument'
         16        INSTANCEOF                                       ~10     ~9, 'Document'
         17        SEND_VAL                                                 ~10
         18        DO_ICALL                                                 
   11    19      > RETURN                                                   !1
   12    20*     > RETURN                                                   null

End of function foo

Class Document: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.91 ms | 1398 KiB | 16 Q