3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function api() { echo 'hi'; } } class b extends a { public function api() { $argv = func_get_args(); return call_user_func_array( array( 'a', 'api' ), $argv ); } } $b = new b(); $b->api();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kKPEs
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'api'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

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

End of function api

End of class a.

Class b:
Function api:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kKPEs
function name:  api
number of ops:  8
compiled vars:  !0 = $argv
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   FUNC_GET_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
   11     2        INIT_USER_CALL                                0          'call_user_func_array', <array>
          3        SEND_ARRAY                                               !0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      0  $3      
          6      > RETURN                                                   $3
   12     7*     > RETURN                                                   null

End of function api

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.16 ms | 1393 KiB | 13 Q