3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function run() { echo "A::do\n"; print_r(func_get_args()); echo "\n"; } } class B extends A { public function run() { echo "A::do\n\n"; call_user_func_array('parent::do', func_get_args()); } } $x = new B(); $x->run(1,2,3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dUljr
function name:  (null)
number of ops:  9
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'run'
          4        SEND_VAL_EX                                              1
          5        SEND_VAL_EX                                              2
          6        SEND_VAL_EX                                              3
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class A:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dUljr
function name:  run
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'A%3A%3Ado%0A'
    6     1        INIT_FCALL                                               'print_r'
          2        FUNC_GET_ARGS                                    ~0      
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
    7     5        ECHO                                                     '%0A'
    8     6      > RETURN                                                   null

End of function run

End of class A.

Class B:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dUljr
function name:  run
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     'A%3A%3Ado%0A%0A'
   15     1        INIT_USER_CALL                                0          'call_user_func_array', 'parent%3A%3Ado'
          2        FUNC_GET_ARGS                                    ~0      
          3        SEND_ARRAY                                               ~0
          4        CHECK_UNDEF_ARGS                                         
          5        DO_FCALL                                      0          
   16     6      > RETURN                                                   null

End of function run

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.72 ms | 1396 KiB | 15 Q