3v4l.org

run code in 500+ PHP versions simultaneously
<?php class B { protected static $c = 1; } class C1 extends B { function f(B $x) { return $x::$c; } } class C2 extends B { protected static $c = 2; } var_dump((new C1)->f(new C2));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Ue97
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'C1'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $0, 'f'
          4        NEW                                                  $2      'C2'
          5        DO_FCALL                                          0          
          6        SEND_VAR_NO_REF_EX                                           $2
          7        DO_FCALL                                          0  $4      
          8        SEND_VAR                                                     $4
          9        DO_ICALL                                                     
         10      > RETURN                                                       1

Class B: [no user functions]
Class C1:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Ue97
function name:  f
number of ops:  5
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        FETCH_CLASS                                       0  $1      !0
          2        FETCH_STATIC_PROP_R              unknown             ~2      'c'
          3      > RETURN                                                       ~2
   10     4*     > RETURN                                                       null

End of function f

End of class C1.

Class C2: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
143.21 ms | 1458 KiB | 14 Q