3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { protected static function c() { return 1; } } class C1 extends B { function f(B $x) { return $x::c(); } } class C2 extends B { protected static function c() { return 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/vjllN
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:
Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vjllN
function name:  c
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   1
          1*     > RETURN                                                   null

End of function c

End of class B.

Class C1:
Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vjllN
function name:  f
number of ops:  6
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        INIT_STATIC_METHOD_CALL                                  $1, 'c'
          3        DO_FCALL                                      0  $2      
          4      > RETURN                                                   $2
   10     5*     > RETURN                                                   null

End of function f

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

End of function c

End of class C1.

Class C2:
Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vjllN
function name:  c
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                   2
          1*     > RETURN                                                   null

End of function c

End of class C2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.14 ms | 1003 KiB | 14 Q