title: How to get function's parameters names in PHP?
body: <p>I'm looking for a sort of reversed <code>func_get_args()</code>. I would like to find out how the parameters were named when function was defined. The reason for this is I don't want to repeat myself when using setting variables passed as arguments through a method:</p>
  
  <pre><code>public function myFunction($paramJohn, $paramJoe, MyObject $paramMyObject)
  {
       $this-&gt;paramJohn = $paramJohn;
       $this-&gt;paramJoe = $paramJoe;
       $this-&gt;paramMyObject = $paramMyObject;
  }
  </code></pre>
  
  <p>Ideally I could do something like:</p>
  
  <pre><code>foreach (func_get_params() as $param)
     $this-&gt;${$param} = ${$param};
  }
  </code></pre>
  
  <p>Is this an overkill, is it a plain stupid idea, or is there a much better way to make this happen?</p>