3v4l.org

run code in 300+ PHP versions simultaneously
<?php $refVariable = false; $refName = 'refVariable'; $callback = function() use (&$refVariable) {}; $function = new \ReflectionFunction($callback); $staticVariables = $function->getStaticVariables(); var_dump(array_key_exists($refName, $staticVariables)); var_dump($refVariable); $staticVariables[$refName] = true; var_dump($refVariable);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9cZFV
function name:  (null)
number of ops:  25
compiled vars:  !0 = $refVariable, !1 = $refName, !2 = $callback, !3 = $function, !4 = $staticVariables
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <false>
    4     1        ASSIGN                                                   !1, 'refVariable'
    5     2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F9cZFV%3A5%240'
          3        BIND_LEXICAL                                             ~7, !0
          4        ASSIGN                                                   !2, ~7
    6     5        NEW                                              $9      'ReflectionFunction'
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !3, $9
    7     9        INIT_METHOD_CALL                                         !3, 'getStaticVariables'
         10        DO_FCALL                                      0  $12     
         11        ASSIGN                                                   !4, $12
    8    12        INIT_FCALL                                               'var_dump'
         13        ARRAY_KEY_EXISTS                                 ~14     !1, !4
         14        SEND_VAL                                                 ~14
         15        DO_ICALL                                                 
    9    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   10    19        ASSIGN_DIM                                               !4, !1
         20        OP_DATA                                                  <true>
   11    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F9cZFV%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9cZFV
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $refVariable
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
          1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F9cZFV%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.36 ms | 1396 KiB | 15 Q