title: PHP default function argument as a T_VARIABLE?
body: <p>I'm trying to provide a member variable as a default value for a class method.</p>
  
  <p>I know it's impossible to use a variable as a default value for a non-class function, but it seems like there should be a way to do this within a class.</p>
  
  <p>There must be a way to do it - perhaps I just have the wrong syntax:</p>
  
  <pre><code>class test{
    private $test = '';
  
    __construct(){
      $this-&gt;test = "whatever";
    }
  
    function getTest($var = $this-&gt;test){
      echo $var;
    }
  }
  </code></pre>
  
  <p>but this throws an error saying something like:</p>
  
  <blockquote>
    <p>$this->test as a function argument default value is not allowed.  unexpected T_VARIABLE.</p>
  </blockquote>
  
  <p>Any thoughts?</p>