title: Use global variables inside static php class
body: <p>As I am new to php oop I have a question how do I use global variables inside a static class with out using the constructor? Or must I use in this case a constructor?</p>
  
  <pre><code>$varGlob = 'hello mars';
  
  class statclass {
  
      global $varglob;
  
      protected static $newVar = $varglob;// not going to work
  
      static public function outputfunc(){
         return statClass::$newVar;
      }
  }
  </code></pre>