3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function vargs() { $args = func_get_args(); print_r($args); } } class B extends A { public function vargs() { $args = func_get_args(); // call_user_func_array(array('parent', 'vargs'), $args); 5.3 - 5.5 if (-1 === version_compare(PHP_VERSION, '5.1.2')) { // 'parent' causes segfault in 5.0.0-5.0.3 call_user_func_array(array(get_parent_class($this), 'vargs'), $args); } else { // call_user_func_array(array($this, 'parent::vargs'), $args); // 5.1.2 } } } $b = new B; $b->vargs(1, 2, 3);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pleKc
function name:  (null)
number of ops:  9
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        INIT_METHOD_CALL                                         !0, 'vargs'
          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 vargs:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pleKc
function name:  vargs
number of ops:  6
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FUNC_GET_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
    8     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    9     5      > RETURN                                                   null

End of function vargs

End of class A.

Class B:
Function vargs:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/pleKc
function name:  vargs
number of ops:  20
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FUNC_GET_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
   18     2        INIT_FCALL                                               'version_compare'
          3        SEND_VAL                                                 '8.0.0'
          4        SEND_VAL                                                 '5.1.2'
          5        DO_ICALL                                         $3      
          6        IS_IDENTICAL                                             $3, -1
          7      > JMPZ                                                     ~4, ->19
   20     8    >   INIT_FCALL                                               'get_parent_class'
          9        FETCH_THIS                                       ~5      
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                         $6      
         12        INIT_ARRAY                                       ~7      $6
         13        ADD_ARRAY_ELEMENT                                ~7      'vargs'
         14        INIT_USER_CALL                                0          'call_user_func_array', ~7
         15        SEND_ARRAY                                               !0
         16        CHECK_UNDEF_ARGS                                         
         17        DO_FCALL                                      0          
         18      > JMP                                                      ->19
   24    19    > > RETURN                                                   null

End of function vargs

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.55 ms | 1400 KiB | 19 Q