title: How to make variable global across entire class
body: <p>Very simple question, is it possible to make a variable that is retrieved from outside of a class, 'global' to the whole class so that I do not have to call the 'global $variable' at the beginning of each method?</p>
  
  <p><strong>This is what I am currently doing:</strong></p>
  
  <pre><code>class test{
      public function testing(){
          global $globalVariable,
  
          // Do something
      }
      public function testing_two(){
          global $globalVariable,
  
          // Do something
      }
  }
  </code></pre>
  
  <p><strong>In other words, can I import variables into the construct function and therefore make them accessible to the entire class without having to call 'global' for each method?</strong></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Not sure if I have made it too clear with what I would like to achieve. Please see below:</p>
  
  <pre><code>$globalVariable = 'hello';
  
  class test{
      public function testing(){
          global $globalVariable,
  
          // Do something
      }
      public function testing_two(){
          global $globalVariable,
  
          // Do something
      }
  }
  </code></pre>