I know this is not exactly reflection, but kind of. I want to make a debug function that gets a variable and prints a var_dump and the variable name.
Of course, when
This is late post but I think it is possible now using compact method
compact
so the code would be
$a=1; $b=2; $c=3 var_dump(compact('a','b','c'));
the output would be
array (size=3) 'a' => int 1 'b' => int 2 'c' => int 3
where variable name a, b and c are the key
Hope this helps