3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public function api() { echo __METHOD__, PHP_EOL; } } class b extends a { public function api() { $argv = func_get_args(); return call_user_func_array( array( 'parent', '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/Wh55Z
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'b'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     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/Wh55Z
function name:  api
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ECHO                                                     'a%3A%3Aapi'
          1        ECHO                                                     '%0A'
    6     2      > 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/Wh55Z
function name:  api
number of ops:  8
compiled vars:  !0 = $argv
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FUNC_GET_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
   12     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
   13     7*     > RETURN                                                   null

End of function api

End of class b.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.96 ms | 1394 KiB | 13 Q