Class Baz contains 1 abstract methods and must therefore be declared abstract (Baz::run)

php.internals

Timm Friebe

22 years ago
Fails: "Fatal error: Class Baz contains 1 abstract methods and must therefore be declared abstract (Baz::run)" (expected behaviour): <?php class Baz { abstract function run(); } ?> Works (no error message, is instantiable): <?php class Bar { } class Foo extends Bar { abstract function run(); } ?> Is this correct? Why would this differ for inherited classes? And why are these checks performed at runtime? - Timm