3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C1 { public function f() { return 'foo'; } public static function __callStatic($method, $args) { return call_user_func_array([(new static), $method], $args); } } echo C1::f(); class C2 { protected function f() { return 'foo'; } public static function __callStatic($method, $args) { return call_user_func_array([(new static), $method], $args); } } echo C2::f();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SGXtf
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'C1', 'f'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   14     3        INIT_STATIC_METHOD_CALL                                  'C2', 'f'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
          6      > RETURN                                                   1

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

End of function f

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

End of function __callstatic

End of class C1.

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

End of function f

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

End of function __callstatic

End of class C2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.15 ms | 1399 KiB | 13 Q