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(); } $xpath3 = new DOMXPath(generate_my_dom_document()); # 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/e0e7T
function name:  (null)
number of ops:  16
compiled vars:  !0 = $xpath3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'DOMXPath'
          1        INIT_FCALL                                               'generate_my_dom_document'
          2        DO_FCALL                                      0  $2      
          3        SEND_VAR_NO_REF_EX                                       $2
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   14     6        FETCH_OBJ_R                                      ~5      !0, 'document'
          7        GET_CLASS                                        ~6      ~5
          8        ECHO                                                     ~6
          9        ECHO                                                     '%0A'
   16    10        INIT_FCALL                                               'var_dump'
         11        FETCH_OBJ_R                                      ~7      !0, 'document'
         12        FETCH_OBJ_R                                      ~8      ~7, 'some_text'
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                                 
         15      > 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/e0e7T
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:
169.51 ms | 1397 KiB | 16 Q