3v4l.org

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

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

End of function f1

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

End of function f2

End of class A.

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

End of function f2

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

End of function f1

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.24 ms | 1399 KiB | 13 Q