title: Access public static variable inside class in function php
body: <p>I am trying to access a variable within a class in a function:</p>
  
  <pre><code>class google_api_v3 {
  
    public static $api_key = 'this is a string';
  
    function send_response() {
       // access here $api_key, I tried with $this-&gt;api_key, but that works only on private and that variable I need also to access it outside the class that is why I need it public.
    }
  
  }
  
  function outside_class() {
    $object = new google_api_v3;
    // works accessing it with $object::api_key
  }
  </code></pre>