3v4l.org

run code in 300+ PHP versions simultaneously
<?php class S{static function __callStatic($k,$f){static $s;return $k=='get'?$s[$f[0]]:$s[$f[0]]=$f[1];}} $sumService = S::set('sum', function($a, $b) { return $a + $b; }); echo S::get('sum')(1, 2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9RlKq
function name:  (null)
number of ops:  15
compiled vars:  !0 = $sumService
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_STATIC_METHOD_CALL                                  'S', 'set'
          1        SEND_VAL_EX                                              'sum'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9RlKq%3A4%240'
    6     3        SEND_VAL_EX                                              ~1
          4        DO_FCALL                                      0  $2      
    4     5        ASSIGN                                                   !0, $2
    8     6        INIT_STATIC_METHOD_CALL                                  'S', 'get'
          7        SEND_VAL_EX                                              'sum'
          8        DO_FCALL                                      0  $4      
          9        INIT_DYNAMIC_CALL                                        $4
         10        SEND_VAL_EX                                              1
         11        SEND_VAL_EX                                              2
         12        DO_FCALL                                      0  $5      
         13        ECHO                                                     $5
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F9RlKq%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9RlKq
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ADD                                              ~2      !0, !1
          3      > RETURN                                                   ~2
    6     4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F9RlKq%3A4%240

Class S:
Function __callstatic:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9RlKq
function name:  __callStatic
number of ops:  16
compiled vars:  !0 = $k, !1 = $f, !2 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        IS_EQUAL                                                 !0, 'get'
          4      > JMPZ                                                     ~3, ->9
          5    >   FETCH_DIM_R                                      ~4      !1, 0
          6        FETCH_DIM_R                                      ~5      !2, ~4
          7        QM_ASSIGN                                        ~6      ~5
          8      > JMP                                                      ->14
          9    >   FETCH_DIM_R                                      ~7      !1, 0
         10        FETCH_DIM_R                                      ~9      !1, 1
         11        ASSIGN_DIM                                       ~8      !2, ~7
         12        OP_DATA                                                  ~9
         13        QM_ASSIGN                                        ~6      ~8
         14    > > RETURN                                                   ~6
         15*     > RETURN                                                   null

End of function __callstatic

End of class S.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155 ms | 1403 KiB | 13 Q