3v4l.org

run code in 300+ PHP versions simultaneously
<?php $var = 'test'; $func = function()use($var) { echo $var; }; $ref = new ReflectionFunction($func); $functionParameters = []; var_dump($ref); foreach($ref->getParameters() as $key => $currentParameter) { $functionParameters[$currentParameter->getName()] = func_get_arg($key); } var_dump($ref->getParameters());
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 25
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/JNfeN
function name:  (null)
number of ops:  32
compiled vars:  !0 = $var, !1 = $func, !2 = $ref, !3 = $functionParameters, !4 = $currentParameter, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'test'
    6     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJNfeN%3A6%240'
          2        BIND_LEXICAL                                             ~7, !0
          3        ASSIGN                                                   !1, ~7
   10     4        NEW                                              $9      'ReflectionFunction'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $9
   12     8        ASSIGN                                                   !3, <array>
   13     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
   14    12        INIT_METHOD_CALL                                         !2, 'getParameters'
         13        DO_FCALL                                      0  $14     
         14      > FE_RESET_R                                       $15     $14, ->25
         15    > > FE_FETCH_R                                       ~16     $15, !4, ->25
         16    >   ASSIGN                                                   !5, ~16
   15    17        INIT_METHOD_CALL                                         !4, 'getName'
         18        DO_FCALL                                      0  $18     
         19        INIT_FCALL                                               'func_get_arg'
         20        SEND_VAR                                                 !5
         21        DO_ICALL                                         $20     
         22        ASSIGN_DIM                                               !3, $18
         23        OP_DATA                                                  $20
   14    24      > JMP                                                      ->15
         25    >   FE_FREE                                                  $15
   17    26        INIT_FCALL                                               'var_dump'
         27        INIT_METHOD_CALL                                         !2, 'getParameters'
         28        DO_FCALL                                      0  $21     
         29        SEND_VAR                                                 $21
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FJNfeN%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.16 ms | 1392 KiB | 17 Q