3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function y($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/K2iPi
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 y:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K2iPi
function name:  y
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 y

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/K2iPi
function name:  __call
number of ops:  19
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
   16    12        INIT_FCALL                                               'forward_static_call'
         13        INIT_ARRAY                                       ~13     'parent'
         14        ADD_ARRAY_ELEMENT                                ~13     !0
         15        SEND_VAL                                                 ~13
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
   17    18      > RETURN                                                   null

End of function __call

Function y:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K2iPi
function name:  y
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 y

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.32 ms | 1400 KiB | 17 Q