title: How to access superglobals in correct way?
body: <p>I'm discovering secrets of PHP. I've found one thing that I don't have answer to. I would like to access variables from super-global $_SESSION in class. Everything works but PHPMD engine to check mess in code is showing me issue. </p>
  
  <p>I'm getting value from $_SESSION super-global this way</p>
  
  <pre><code>$value = $_SESSION["value"];
  </code></pre>
  
  <p>And I'm editting values of $_SESSION super-global this way</p>
  
  <pre><code>$_SESSION['value'] = "newValue";
  </code></pre>
  
  <p>PHPMD is showing me issue: </p>
  
  <blockquote>
    <p>accesses the super-global variable $_SESSION.</p>
  </blockquote>
  
  <p><strong>So I'm finding another way how to edit and get values of super-global $_SESSION correctly.</strong></p>
  
  <p>I've tried to use filter_input, problem is that when I use INPUT_POST as type(argument 1), PHP shows me warning: </p>
  
  <blockquote>
    <p>INPUT_SESSION is not yet implemented</p>
  </blockquote>
  
  <p>Thanks for future answers :)</p>
  
  <p>EDIT (Quotes from phpmd documentation)</p>
  
  <blockquote>
    <p>Superglobals
    Since: PHPMD 0.2.
    Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.</p>
  </blockquote>