3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class Foo { private function doFoo() { echo __METHOD__; } } class Bar extends Foo { public static function doBar() { $bar = new Bar(); $bar->doFoo(); } } Bar::doBar();
based on 8p8bQ
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to private method Foo::doFoo() from context 'Bar' in /in/gDfPn:12 Stack trace: #0 /in/gDfPn(16): Bar::doBar() #1 {main} thrown in /in/gDfPn on line 12
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Call to private method Foo::doFoo() from context 'Bar' in /in/gDfPn on line 12
Process exited with code 255.