title: PHP var_dump on array returns NULL when called inside function
body: <p>I have a PHP-file looking something like this:</p>
  
  <pre><code>&lt;?php
      $ERRORS = array(
          '0' =&gt; "Unauthorized access",
          '1' =&gt; "Wrong username / password",
          '2' =&gt; "Missing field(s)",
          '3' =&gt; "Passwords do not match!"
      );
  
      var_dump($ERRORS);
  
      function getErrorMessage($errorCode){
          var_dump($ERRORS);
  
          // More code to output the corresponding message
  
      }
  ?&gt;
  </code></pre>
  
  <p>When executed, the first <code>var_dump($ERRORS)</code> outputs </p>
  
  <blockquote>
    <p>array(4) { [0]=> string(19) "Unauthorized access" [1]=> string(25) "Wrong username / password" [2]=> string(16) "Missing field(s)" [3]=> string(23) "Passwords do not match!" } </p>
  </blockquote>
  
  <p>But the the <code>var_dump</code> inside the function returns <code>NULL</code></p>
  
  <p>What is the cause of this, and how can I prevent it?</p>