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(); } } class Baz { public static function baz() { echo __METHOD__; } } Baz::baz();
based on Nuekf
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; Baz has a deprecated constructor in /in/8p8bQ on line 16 Fatal error: Constructor Baz::baz() cannot be static in /in/8p8bQ on line 16
Process exited with code 255.
Output for 5.3.21 - 5.6.17
Fatal error: Constructor Baz::baz() cannot be static in /in/8p8bQ on line 20
Process exited with code 255.