title: PHP array performance - memory wise
body: <p>I have an array of size 5 MB, I am passing it to functions to functions (I am not passing it <strong>by reference</strong>)</p>
  
  <pre><code>foo( $arr );
  
  function foo( $arr ) {
      ....
      bar( $arr );
      ....
  }
  
  function bar( $arr ) {
      ....
      test( $arr );
      ....
  }
  
  function test( $arr ) {
      ....
      test2( $arr );
      ....
  }
  </code></pre>
  
  <p>PHP passes array values <strong>by value</strong> (copy of value) by default to functions.</p>
  
  <p>my question is,  if this array value is passed to 100 functions calls, will the PHP consumes <strong>100 x 5 MB = 500 MB</strong> of memory ?</p>
  
  <p>How the PHP handles big arrays ( in memory wise ) on function calls?</p>