3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a { protected static $foo = array(); public static function foo(){ var_dump(self::$foo); } public static function bar(){ self::$foo[] = 'foo'; } } class b extends a{ public static function foo(){ self::$foo[] = 'bar'; } } a::foo(); a::bar(); a::foo(); b::foo(); a::foo();
Output for 5.3.7 - 7.1.0
array(0) { } array(1) { [0]=> string(3) "foo" } array(2) { [0]=> string(3) "foo" [1]=> string(3) "bar" }