PHP OOP, create new var or use properties
<p>This is a practical question, say you have this class</p>

<pre><code>class foo{
  public $variable_1 = "something 1";
  public $variable_2 = "something 2";
  public $variable_3 = "something 3";

  function do_stuff(){
     //do something with properties
     if(true){
        $this-&gt;variable_1 = "new value";
     }else{
        $this-&gt;variable_3 = "it was false!";
     }
  }
}
</code></pre>

<p>So this looks like a right way to mess around with <code>foo</code> object <code>properties</code> but say we have a lot of properties and a very long function.</p>

<p>In that case would you set a new variable in that function so the code would look clearer, say: <code>$user = $this-&gt;variable_3</code>?</p>

<p>This definately makes things more clear and easy to read, but if that property holds very large array or something else that would duplicate data, so i guess that isn't very good... </p>
