3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct() { var_dump(func_get_args()); } } class B extends A { function __construct() { // call the parent constructor with whatever parameters were provided call_user_func_array(array('parent', '__construct'), func_get_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/AjCMb
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     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/AjCMb
function name:  __construct
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'var_dump'
          1        FUNC_GET_ARGS                                    ~0      
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
    5     4      > 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/AjCMb
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_USER_CALL                                0          'call_user_func_array', <array>
          1        FUNC_GET_ARGS                                    ~0      
          2        SEND_ARRAY                                               ~0
          3        CHECK_UNDEF_ARGS                                         
          4        DO_FCALL                                      0          
   14     5        ECHO                                                     'B'
   15     6      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.17 ms | 1395 KiB | 15 Q