There are many ways to do it no one mentioned about static keyword
you can do inside class:
static::$api_key
You can also use references and keywords like parent, self or using class name.
There is difference between self and static. When you override static variable in class self:: will point to the class where it was called and static:: does is wiser and will check ovverides. There's example from php.net side written in comments I've modifed it a bit just to show differences.
<?php abstract class a { static protected $test="class a"; public function static_test() { echo static::$test; // Results class b echo self::$test; // Results class a echo a::$test; // Results class a echo b::$test; // Results class b } } class b extends a { static protected $test="class b"; } $obj = new b(); $obj->static_test();
Output:
class b class a class a class b
More on:
http://php.net/manual/pl/language.oop5.static.php