3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { static $i = 1; } var_dump((new ReflectionFunction('foo'))->getStaticVariables()['i']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72Nnr
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'ReflectionFunction'
          2        SEND_VAL_EX                                              'foo'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getStaticVariables'
          5        DO_FCALL                                      0  $2      
          6        FETCH_DIM_R                                      ~3      $2, 'i'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/72Nnr
function name:  foo
number of ops:  2
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.2 ms | 1012 KiB | 14 Q