3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { public static function test() { static::foo(); static::bar(); } public static function foo() { echo __METHOD__ . " called\n"; } private static function bar() { echo __METHOD__ . " called\n"; } } class b extends a { } class c extends a { public static function foo() { echo __METHOD__ . " called\n"; } private static function bar() { echo __METHOD__ . " called\n"; } } a::test(); b::test(); c::test();
based on bG1Ad
Output for 7.0.0 - 7.2.0
a::foo called a::bar called a::foo called a::bar called c::foo called Fatal error: Uncaught Error: Call to private method c::bar() from context 'a' in /in/FvIKO:6 Stack trace: #0 /in/FvIKO(35): a::test() #1 {main} thrown in /in/FvIKO on line 6
Process exited with code 255.
Output for 5.3.17 - 5.6.28
a::foo called a::bar called a::foo called a::bar called c::foo called Fatal error: Call to private method c::bar() from context 'a' in /in/FvIKO on line 6
Process exited with code 255.