3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __call($name, $args) { var_dump('SUPER'); } } class Bar extends Foo { public function __call($name, $args) { $args_get = func_get_args(); $reflection = new ReflectionObject($this); $parentReflection = $reflection->getParentClass(); call_user_func_array([$parentReflection->name, $name], $args); // forward_static_call(['parent', $name], $args); } } $bar = (new Bar)->y(4,2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VcLD
function name:  (null)
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Bar'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'y'
          3        SEND_VAL_EX                                              4
          4        SEND_VAL_EX                                              2
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !0, $3
          7      > RETURN                                                   1

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

End of function __call

End of class Foo.

Class Bar:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1VcLD
function name:  __call
number of ops:  20
compiled vars:  !0 = $name, !1 = $args, !2 = $args_get, !3 = $reflection, !4 = $parentReflection
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        FUNC_GET_ARGS                                    ~5      
          3        ASSIGN                                                   !2, ~5
   13     4        NEW                                              $7      'ReflectionObject'
          5        FETCH_THIS                                       $8      
          6        SEND_VAR_EX                                              $8
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !3, $7
   14     9        INIT_METHOD_CALL                                         !3, 'getParentClass'
         10        DO_FCALL                                      0  $11     
         11        ASSIGN                                                   !4, $11
   15    12        FETCH_OBJ_R                                      ~13     !4, 'name'
         13        INIT_ARRAY                                       ~14     ~13
         14        ADD_ARRAY_ELEMENT                                ~14     !0
         15        INIT_USER_CALL                                0          'call_user_func_array', ~14
         16        SEND_ARRAY                                               !1
         17        CHECK_UNDEF_ARGS                                         
         18        DO_FCALL                                      0          
   17    19      > RETURN                                                   null

End of function __call

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.45 ms | 1400 KiB | 15 Q