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')) { call_user_func_array(array('parent', '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/driEA
function name:  (null)
number of ops:  9
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   NEW                                              $1      'B'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     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/driEA
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 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/driEA
function name:  vargs
number of ops:  21
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, ->13
   19     8    >   INIT_USER_CALL                                0          'call_user_func_array', <array>
          9        SEND_ARRAY                                               !0
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0          
         12      > JMP                                                      ->20
   21    13    >   FETCH_THIS                                       ~6      
         14        INIT_ARRAY                                       ~7      ~6
         15        ADD_ARRAY_ELEMENT                                ~7      'parent%3A%3Avargs'
         16        INIT_USER_CALL                                0          'call_user_func_array', ~7
         17        SEND_ARRAY                                               !0
         18        CHECK_UNDEF_ARGS                                         
         19        DO_FCALL                                      0          
   23    20    > > RETURN                                                   null

End of function vargs

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.3 ms | 1400 KiB | 17 Q