title: Can't access a declared global variable in WordPress
body: <p>I have the following code:</p>
  
  <pre><code>$g_value = 'something';
  print "$g_value";
  
  function get_value() {
  
      global $g_value;
      print $g_value;
  }
  
  print get_value();
  </code></pre>
  
  <p>When I run it in a stand-alone PHP script, I get 'somethingsomething'. However, when I run it in a WordPress plugin, I only get 'something'- the global declaration does not make the var accessible in the function. I thought this should always work, and isn't dependent on register_globals or any other environment setting. What's going on here?</p>