3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { public function f1() { return 'f1'; } protected function f2() { return 'f2'; } private function f3() { return 'f3'; } public function __call($method, $args) { return call_user_func_array([$this, $method], $args); } public static function __callStatic($method, $args) { $me = new static; return call_user_func_array([$me, $method], $args); } } $c = new C; echo $c->f1(); echo $c->f2(); echo $c->f3(); echo C::f1(); echo C::f2(); echo C::f3();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bgYtT
function name:  (null)
number of ops:  22
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'C'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_METHOD_CALL                                         !0, 'f1'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   17     6        INIT_METHOD_CALL                                         !0, 'f2'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
   18     9        INIT_METHOD_CALL                                         !0, 'f3'
         10        DO_FCALL                                      0  $6      
         11        ECHO                                                     $6
   19    12        INIT_STATIC_METHOD_CALL                                  'C', 'f1'
         13        DO_FCALL                                      0  $7      
         14        ECHO                                                     $7
   20    15        INIT_STATIC_METHOD_CALL                                  'C', 'f2'
         16        DO_FCALL                                      0  $8      
         17        ECHO                                                     $8
   21    18        INIT_STATIC_METHOD_CALL                                  'C', 'f3'
         19        DO_FCALL                                      0  $9      
         20        ECHO                                                     $9
         21      > RETURN                                                   1

Class C:
Function f1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bgYtT
function name:  f1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > RETURN                                                   'f1'
          1*     > RETURN                                                   null

End of function f1

Function f2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bgYtT
function name:  f2
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   'f2'
          1*     > RETURN                                                   null

End of function f2

Function f3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bgYtT
function name:  f3
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'f3'
          1*     > RETURN                                                   null

End of function f3

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bgYtT
function name:  __call
number of ops:  11
compiled vars:  !0 = $method, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        FETCH_THIS                                       ~2      
          3        INIT_ARRAY                                       ~3      ~2
          4        ADD_ARRAY_ELEMENT                                ~3      !0
          5        INIT_USER_CALL                                0          'call_user_func_array', ~3
          6        SEND_ARRAY                                               !1
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      0  $4      
          9      > RETURN                                                   $4
    8    10*     > RETURN                                                   null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bgYtT
function name:  __callStatic
number of ops:  13
compiled vars:  !0 = $method, !1 = $args, !2 = $me
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        NEW                          static              $3      
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $3
   11     5        INIT_ARRAY                                       ~6      !2
          6        ADD_ARRAY_ELEMENT                                ~6      !0
          7        INIT_USER_CALL                                0          'call_user_func_array', ~6
          8        SEND_ARRAY                                               !1
          9        CHECK_UNDEF_ARGS                                         
         10        DO_FCALL                                      0  $7      
         11      > RETURN                                                   $7
   12    12*     > RETURN                                                   null

End of function __callstatic

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.61 ms | 1399 KiB | 13 Q