3v4l.org

run code in 500+ PHP versions simultaneously
<?php $var = 'test'; $var2 = 'test2'; $func = function()use($var,$var2) { echo $var; }; $ref = new ReflectionFunction($func); var_dump($ref); $functionParameters = []; var_dump($ref->getStaticVariables());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hDl07
function name:  (null)
number of ops:  20
compiled vars:  !0 = $var, !1 = $var2, !2 = $func, !3 = $ref, !4 = $functionParameters
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                       !0, 'test'
    5     1        ASSIGN                                                       !1, 'test2'
    6     2        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
          3        BIND_LEXICAL                                                 ~7, !0
          4        BIND_LEXICAL                                                 ~7, !1
          5        ASSIGN                                                       !2, ~7
   10     6        NEW                                                  $9      'ReflectionFunction'
          7        SEND_VAR_EX                                                  !2
          8        DO_FCALL                                          0          
          9        ASSIGN                                                       !3, $9
   11    10        INIT_FCALL                                                   'var_dump'
         11        SEND_VAR                                                     !3
         12        DO_ICALL                                                     
   12    13        ASSIGN                                                       !4, <array>
   13    14        INIT_FCALL                                                   'var_dump'
         15        INIT_METHOD_CALL                                             !3, 'getStaticVariables'
         16        DO_FCALL                                          0  $14     
         17        SEND_VAR                                                     $14
         18        DO_ICALL                                                     
         19      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hDl07
function name:  {closure:/in/hDl07:6}
number of ops:  4
compiled vars:  !0 = $var, !1 = $var2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                                  !0
          1        BIND_STATIC                                                  !1
    7     2        ECHO                                                         !0
    8     3      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.67 ms | 2156 KiB | 14 Q