3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Demo { public static $cache; static function test($id, $val) { return self::$cache[$id] = $val; } } echo Demo::test(1, 1); echo Demo::test(2, 2); var_dump(Demo::$cache);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HOprf
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_STATIC_METHOD_CALL                                  'Demo', 'test'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 1
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
   13     5        INIT_STATIC_METHOD_CALL                                  'Demo', 'test'
          6        SEND_VAL                                                 2
          7        SEND_VAL                                                 2
          8        DO_FCALL                                      0  $1      
          9        ECHO                                                     $1
   15    10        INIT_FCALL                                               'var_dump'
         11        FETCH_STATIC_PROP_R          unknown             ~2      'cache'
         12        SEND_VAL                                                 ~2
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class Demo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HOprf
function name:  test
number of ops:  7
compiled vars:  !0 = $id, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        FETCH_STATIC_PROP_W          global              $2      'cache'
          3        ASSIGN_DIM                                       ~3      $2, !0
          4        OP_DATA                                                  !1
          5      > RETURN                                                   ~3
    8     6*     > RETURN                                                   null

End of function test

End of class Demo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.8 ms | 1395 KiB | 15 Q