3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { protected function do_something() { echo('ado_something'); } public function return_output() { $op = $this->do_something(); // add some wrappers to $op return $op; } } class B extends A { protected function do_something() { echo('bdo_something'); } } $newClass = new B; echo $newClass->return_output();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JvGu
function name:  (null)
number of ops:  7
compiled vars:  !0 = $newClass
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, 'return_output'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

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

End of function do_something

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

End of function return_output

End of class A.

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

End of function do_something

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

End of function return_output

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.46 ms | 1386 KiB | 13 Q