3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { } class B extends A { public self $instOfSelf; public parent $instOfParent; } $b = new B(); $b->instOfParent = new B(); # Allowed var_dump($b); $b->instOfParent = new A(); # Also allowed var_dump($b); $b->instOfSelf = new B(); # Allowed var_dump($b); $b->instOfSelf = new A(); # ERROR var_dump($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n820F
function name:  (null)
number of ops:  32
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   12     3        NEW                                              $5      'B'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               !0, 'instOfParent'
          6        OP_DATA                                                  $5
   13     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
   15    10        NEW                                              $9      'A'
         11        DO_FCALL                                      0          
         12        ASSIGN_OBJ                                               !0, 'instOfParent'
         13        OP_DATA                                                  $9
   16    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                                 
   18    17        NEW                                              $13     'B'
         18        DO_FCALL                                      0          
         19        ASSIGN_OBJ                                               !0, 'instOfSelf'
         20        OP_DATA                                                  $13
   19    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
   21    24        NEW                                              $17     'A'
         25        DO_FCALL                                      0          
         26        ASSIGN_OBJ                                               !0, 'instOfSelf'
         27        OP_DATA                                                  $17
   22    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]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.04 ms | 1400 KiB | 15 Q