3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A{ protected function value() { return "a"; } public function get() { return $this->value(); } } class B extends A{ protected function value() { return "b"; } } echo (new B)->get();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rsL7j
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'get'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

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

End of function value

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

End of function get

End of class A.

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

End of function value

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

End of function get

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.06 ms | 1008 KiB | 13 Q