3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct() { $args = func_get_args(); var_dump($args); } } class B extends A { function __construct() { // call the parent constructor with whatever parameters were provided $args = func_get_args(); call_user_func_array(array('parent', '__construct'), $args); // Additional actions that do not need direct access to the parameters echo __CLASS__; } } new B(1,2,3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ns8BI
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $0      'B'
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              2
          3        SEND_VAL_EX                                              3
          4        DO_FCALL                                      0          
          5        FREE                                                     $0
          6      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ns8BI
function name:  __construct
number of ops:  6
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FUNC_GET_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
    5     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    6     5      > RETURN                                                   null

End of function __construct

End of class A.

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

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.37 ms | 1395 KiB | 15 Q