3v4l.org

run code in 300+ PHP versions simultaneously
<?php function variable_get($name, $default = NULL) { global $conf; return isset($conf[$name]) ? $conf[$name] : $default; } class at_fn { public static function __callStatic($fn, $args) { return call_user_func_array(variable_get("atfn:{$fn}", $fn), $args); } } class at_fake { public static function __callStatic($fn, $args) { $GLOBALS['conf']["atfn:{$fn}"] = $args[0]; } } $time = time(); at_fake::time(function() use ($time) { return $time; }); print_r(at_fn::time());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uX8u0
function name:  (null)
number of ops:  14
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
   22     3        INIT_STATIC_METHOD_CALL                                  'at_fake', 'time'
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuX8u0%3A22%240'
          5        BIND_LEXICAL                                             ~3, !0
          6        SEND_VAL_EX                                              ~3
          7        DO_FCALL                                      0          
   23     8        INIT_FCALL                                               'print_r'
          9        INIT_STATIC_METHOD_CALL                                  'at_fn', 'time'
         10        DO_FCALL                                      0  $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function variable_get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uX8u0
function name:  variable_get
number of ops:  11
compiled vars:  !0 = $name, !1 = $default, !2 = $conf
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
    4     2        BIND_GLOBAL                                              !2, 'conf'
    6     3        ISSET_ISEMPTY_DIM_OBJ                         0          !2, !0
          4      > JMPZ                                                     ~3, ->8
          5    >   FETCH_DIM_R                                      ~4      !2, !0
          6        QM_ASSIGN                                        ~5      ~4
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~5      !1
          9    > > RETURN                                                   ~5
    7    10*     > RETURN                                                   null

End of function variable_get

Function %00%7Bclosure%7D%2Fin%2FuX8u0%3A22%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uX8u0
function name:  {closure}
number of ops:  3
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   BIND_STATIC                                              !0
          1      > RETURN                                                   !0
          2*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FuX8u0%3A22%240

Class at_fn:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uX8u0
function name:  __callStatic
number of ops:  14
compiled vars:  !0 = $fn, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        INIT_FCALL                                               'variable_get'
          3        NOP                                                      
          4        FAST_CONCAT                                      ~2      'atfn%3A', !0
          5        SEND_VAL                                                 ~2
          6        SEND_VAR                                                 !0
          7        DO_FCALL                                      0  $3      
          8        INIT_USER_CALL                                0          'call_user_func_array', $3
          9        SEND_ARRAY                                               !1
         10        CHECK_UNDEF_ARGS                                         
         11        DO_FCALL                                      0  $4      
         12      > RETURN                                                   $4
   12    13*     > RETURN                                                   null

End of function __callstatic

End of class at_fn.

Class at_fake:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uX8u0
function name:  __callStatic
number of ops:  10
compiled vars:  !0 = $fn, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        NOP                                                      
          3        FAST_CONCAT                                      ~4      'atfn%3A', !0
          4        FETCH_DIM_R                                      ~6      !1, 0
          5        FETCH_W                      global              $2      'GLOBALS'
          6        FETCH_DIM_W                                      $3      $2, 'conf'
          7        ASSIGN_DIM                                               $3, ~4
          8        OP_DATA                                                  ~6
   18     9      > RETURN                                                   null

End of function __callstatic

End of class at_fake.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.28 ms | 1403 KiB | 18 Q