title: The advantage / disadvantage between global variables and function parameters in PHP?
body: <p>sorry i'm a beginner and i can't determine how good a question this is, maybe it sounds utterly obvious to some of you.</p>
  
  <p>if <em>our use</em> of these two below is the same which is better?</p>
  
  <pre><code>function doSomething ($var1,$var2,..){
      ...
  }
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>function doSomething (){
      global $var1,$var2,..;
      ...
  }
  </code></pre>
  
  <p>by our use I mean that I know that in the second scenario we can also alter the global variables' value. but what if we don't need to do that, which is the better way of writing this function? does passing variables take less memory than announcing global's in a function?</p>