3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { protected static $foo = 'foo'; public function saySelfFoo() { echo self::$foo . PHP_EOL; } public function sayStaticFoo() { echo static::$foo . PHP_EOL; } } class B extends A { protected static $foo = 'bar'; } $a = new A(); $b = new B(); $a->saySelfFoo(); $b->saySelfFoo(); $a->sayStaticFoo(); $b->sayStaticFoo();
based on MCI8k
Output for 5.5.0 - 7.3.0rc4
foo foo foo bar