3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDOMDocument extends DOMDocument { public $some_text = 'foobar'; } function generate_my_dom_document() { return new MyDOMDocument(); } $doc = generate_my_dom_document(); $xpath3 = new DOMXPath($doc); # buggy behavior: reports 'DOMDocument', the base class echo get_class($xpath3->document), "\n"; # buggy behavior: reports 'Undefined property' var_dump($xpath3->document->some_text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7i3n
function name:  (null)
number of ops:  17
compiled vars:  !0 = $doc, !1 = $xpath3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'generate_my_dom_document'
          1        DO_FCALL                                      0  $2      
          2        ASSIGN                                                   !0, $2
   12     3        NEW                                              $4      'DOMXPath'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $4
   14     7        FETCH_OBJ_R                                      ~7      !1, 'document'
          8        GET_CLASS                                        ~8      ~7
          9        ECHO                                                     ~8
         10        ECHO                                                     '%0A'
   16    11        INIT_FCALL                                               'var_dump'
         12        FETCH_OBJ_R                                      ~9      !1, 'document'
         13        FETCH_OBJ_R                                      ~10     ~9, 'some_text'
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Function generate_my_dom_document:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Q7i3n
function name:  generate_my_dom_document
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $0      'MyDOMDocument'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    9     3*     > RETURN                                                   null

End of function generate_my_dom_document

Class MyDOMDocument: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.98 ms | 1398 KiB | 16 Q