title: Global variable from included file in static function
body: <p>I have <em>index.php</em> with included file <em>strings.php</em> for translating phrases. In <em>strings.php</em> is included file based on user language: <em>$lang.php</em>. This <em>$lang.php</em> file is automatically generated from <em>$lang.ini</em> and contains single array:</p>
  
  <pre><code>  &lt;?php $translation = array (
        'USER_PROFILE' =&gt; 'Uživatelský profil',
        'MESSAGES' =&gt; 'Zprávy',
        'NOTIFICATIONS' =&gt; 'Oznámení',
        'SETTINGS' =&gt; 'Nastavení',
        ...
  </code></pre>
  
  <p>There is a class Strings with static function and globally assigned array <em>$translation</em> from <em>$lang.php</em> in <em>strings.php</em>:</p>
  
  <pre><code>include_once('cache/'.$lang.'.php');
  
  class Strings {
      static public function translate($string) {
          global $translation;
          ...
      }
  }
  </code></pre>
  
  <p>But <em>$translation</em> in <em>translate()</em> function returns null in this case. If I include <em>$lang.php</em> in <em>index.php</em> it suddenly works, but if I call <em>Strings::translate()</em> function in other file, <em>$translation</em> again returns null. I don't understand this behavior. (Sorry for english)</p>