title: Weird PHP Introspection: Get original variable NAMES from function call?
body: <p>I have a strange question that's probably not possible, but it's worth asking in case there are any PHP internals nerds who know a way to do it. Is there any way to get the variable name from a function call within PHP? It'd be easier to give an example:</p>
  
  <pre><code>function fn($argument) {
      echo SOME_MAGIC_FUNCTION();
  }
  
  $var1 = "foo";
  $var2 = "bar";
  
  fn($var1); // outputs "$var1", not "foo"
  fn($var2); // outputs "$var2", not "bar"
  </code></pre>
  
  <p>Before you say it - yes, I know this would be a terrible idea with no use in production code. However, I'm migrating some old code to new code, and this would allow me to very easily auto-generate the replacement code. Thanks!</p>