title: Is using superglobals directly good or bad in PHP?
body: <p>So, I don't come from a huge PHP background—and I was wondering if in well formed code, one should use the 'superglobals' directly, e.g. in the middle of some function say <code>$_SESSION['x'] = 'y';</code> or if, like I'd normally do with variables, it's better to send them as arguments that can be used from there, e.g:</p>
  
  <pre><code>class Doer {
      private $sess;
      public function __construct(&amp;$sess) {
          $this-&gt;sess =&amp; $sess;
      }
  } 
  
  $doer = new Doer($_SESSION);
  </code></pre>
  
  <p>and then use the <code>Doer-&gt;sess</code> version from within Doer and such. (The advantage of this method is that it makes clear that <code>Doer</code> uses $_SESSION.)</p>
  
  <p>What's the accepted PHP design approach for this problem?</p>