title: get class variable in static method
body: <p>I have a class variable that I need to have available without an instance of the class. Something like</p>
  
  <pre><code>$size = Image::getSize('original');
  </code></pre>
  
  <p>Here's my attempt, but it getSize returns null.</p>
  
  <pre><code>class Image extends Model {
  
      protected $sizes =
      ['original'=&gt;['w'=&gt;'2048','h'=&gt;'1536','f'=&gt;'1'],
          'originalSquare'=&gt;['w'=&gt;'2048','h'=&gt;'1536','f'=&gt;'1'],
          'thumb'=&gt;['w'=&gt;'120','h'=&gt;'120','f'=&gt;'1'],
          'overview'=&gt;['w'=&gt;'554','h'=&gt;'415','f'=&gt;'3'],
          'category'=&gt;['w'=&gt;'260','h'=&gt;'195','f'=&gt;'2'],
          'medium'=&gt;['w'=&gt;'554','h'=&gt;'415','f'=&gt;'1']];
  
      public static function getSize($size)
      {
  
          return(self::$sizes[$size]);
      }
  }
  </code></pre>
  
  <p>Is there a better way to accomplish this? $sizes is also used internally by an instance of this class.</p>