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) { var_dump('WOOOOW'); $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/vgWJh
function name:  (null)
number of ops:  8
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     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/vgWJh
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/vgWJh
function name:  __call
number of ops:  22
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        INIT_FCALL                                               'var_dump'
          3        SEND_VAL                                                 'WOOOOW'
          4        DO_ICALL                                                 
   13     5        FUNC_GET_ARGS                                    ~6      
          6        ASSIGN                                                   !2, ~6
   14     7        NEW                                              $8      'ReflectionObject'
          8        FETCH_THIS                                       $9      
          9        SEND_VAR_EX                                              $9
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !3, $8
   15    12        INIT_METHOD_CALL                                         !3, 'getParentClass'
         13        DO_FCALL                                      0  $12     
         14        ASSIGN                                                   !4, $12
   17    15        INIT_FCALL                                               'forward_static_call'
         16        INIT_ARRAY                                       ~14     'parent'
         17        ADD_ARRAY_ELEMENT                                ~14     !0
         18        SEND_VAL                                                 ~14
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
   18    21      > 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/vgWJh
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:
162.21 ms | 1392 KiB | 17 Q