title: Does php7 still support global variables?
body: <p>It is possible to use global variable within function in <strong>php7</strong>? It worked properly in php5.4.</p>
  
  <p>I have found that keyword <strong>global</strong> is not usefull any more in php7:</p>
  
  <blockquote>
    <p>global only accepts simple variables <a href="http://php.net/manual/en/migration70.incompatible.php" rel="noreferrer">migration70.incompatible</a></p>
  </blockquote>
  
  <p>But There on page about GLOBALS <a href="http://php.net/manual/en/reserved.variables.globals.php" rel="noreferrer">reserved.variables.globals</a> 
  it is still written that (PHP 4, PHP 5, PHP 7) should support GLOBALS.</p>
  
  <p>Unfortunatelly, nothing of these work for me:</p>
  
  <pre><code>function printGlobal(){
    global ${$a};
    global $b;
    echo '&lt;br/&gt;-'.${$a};
    echo '&lt;br/&gt;-'.$b;
    echo '&lt;br/&gt;-'.$GLOBALS['c'];
  }
  
  $a = "hello";
  $b = 7;
  $c = 6;
  
  printGlobal();
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>-
  -
  -
  </code></pre>
  
  <p>Please do not start a discussion about avoiding of usage of global variables :)</p>
  
  <p>--- EDIT:</p>
  
  <p>I missed, that X.php file I worked with is included withinin index.php file in a function includeAnotherPage(..). Thus, variable defined in X.php file cannot be global variable - because whole X.php file is already in a function. Therefore, codes, writen above, did not work.</p>
  
  <p>Ok thank you for replies. I am stupid and the article locked me in the feeling that globals could be deactivated. </p>