3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { static $a = 0, $b = 15; $a++; $b++; return $a; } $rf = new ReflectionFunction('test'); // result - Array ( [a] => 0 [b] => 15 ) var_dump( $rf->getStaticVariables() );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6SNnQ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $rf
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $1      'ReflectionFunction'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   14     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'getStaticVariables'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6SNnQ
function name:  test
number of ops:  6
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
          1        BIND_STATIC                                              !1
    6     2        PRE_INC                                                  !0
    7     3        PRE_INC                                                  !1
    8     4      > RETURN                                                   !0
    9     5*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.35 ms | 942 KiB | 16 Q