Passing data to function. What is the better way? : <p>Way 1:</p>

<pre><code>public $foo = 1;
function(){
   return $this-&gt;foo+1;
}
</code></pre>

<p>Way 2:</p>

<pre><code>// with $foo = 1 in other function
function($foo){
    return $foo+1;
}
</code></pre>

<p>Sorry for a 'dumb' question, someone can tell me what is the better way?</p>
