3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public static function echoes($b) { echo $b->protectedFunction(); } } class B extends A { protected function protectedFunction() { return "this is protected"; } } class C { public static function echoes($b) { echo $b->protectedFunction(); } } $b = new B(); A::echoes($b); C::echoes($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JTpuQ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   24     0  E >   NEW                                                  $1      'B'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   27     3        INIT_STATIC_METHOD_CALL                                      'A', 'echoes'
          4        SEND_VAR                                                     !0
          5        DO_FCALL                                          0          
   29     6        INIT_STATIC_METHOD_CALL                                      'C', 'echoes'
          7        SEND_VAR                                                     !0
          8        DO_FCALL                                          0          
          9      > RETURN                                                       1

Class A:
Function echoes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JTpuQ
function name:  echoes
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        INIT_METHOD_CALL                                             !0, 'protectedFunction'
          2        DO_FCALL                                          0  $1      
          3        ECHO                                                         $1
    8     4      > RETURN                                                       null

End of function echoes

End of class A.

Class B:
Function protectedfunction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JTpuQ
function name:  protectedFunction
number of ops:  2
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E > > RETURN                                                       'this+is+protected'
   15     1*     > RETURN                                                       null

End of function protectedfunction

Function echoes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JTpuQ
function name:  echoes
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        INIT_METHOD_CALL                                             !0, 'protectedFunction'
          2        DO_FCALL                                          0  $1      
          3        ECHO                                                         $1
    8     4      > RETURN                                                       null

End of function echoes

End of class B.

Class C:
Function echoes:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JTpuQ
function name:  echoes
number of ops:  5
compiled vars:  !0 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   RECV                                                 !0      
   20     1        INIT_METHOD_CALL                                             !0, 'protectedFunction'
          2        DO_FCALL                                          0  $1      
          3        ECHO                                                         $1
   21     4      > RETURN                                                       null

End of function echoes

End of class C.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.95 ms | 2068 KiB | 13 Q