3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class Foo { private function foo() { echo __METHOD__; } } class Bar extends Foo { public static function bar() { $bar = new Bar(); $bar->foo(); } } class Baz { public static function baz() { echo __METHOD__; } } Baz::baz();
based on UPiiF
Output for 7.0.0 - 7.0.2
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/Nuekf on line 3 Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Bar has a deprecated constructor in /in/Nuekf on line 9 Fatal error: Constructor Bar::bar() cannot be static in /in/Nuekf on line 9
Process exited with code 255.
Output for 5.3.21 - 5.6.17
Fatal error: Constructor Bar::bar() cannot be static in /in/Nuekf on line 14
Process exited with code 255.