3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { } class B extends A { public parent $instOfParent; # equivalent to "public A $instOfParent" } class C extends B { } class Beta extends A { } $b = new B(); $b->instOfParent = new A(); # A is B's parent var_dump($b); $b->instOfParent = new A(); # B is a sub-class of A var_dump($b); $b->instOfParent = new C(); # C is a sub-sub-class of A var_dump($b); $b->instOfParent = new Beta(); # Beta is a sub-class of A (but not of B) var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2qeIS
function name:  (null)
number of ops:  32
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        NEW                                              $5      'A'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'instOfParent'
          6        OP_DATA                                                  $5
   16     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   18    10        NEW                                              $9      'A'
         11        DO_FCALL                                      0          
         12        ASSIGN_OBJ                                               !0, 'instOfParent'
         13        OP_DATA                                                  $9
   19    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   21    17        NEW                                              $13     'C'
         18        DO_FCALL                                      0          
         19        ASSIGN_OBJ                                               !0, 'instOfParent'
         20        OP_DATA                                                  $13
   22    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
   24    24        NEW                                              $17     'Beta'
         25        DO_FCALL                                      0          
         26        ASSIGN_OBJ                                               !0, 'instOfParent'
         27        OP_DATA                                                  $17
   25    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Class A: [no user functions]
Class B: [no user functions]
Class C: [no user functions]
Class Beta: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
127.54 ms | 1401 KiB | 15 Q