Why does PHP 5.2 disallow abstract static class methods?
Posted
by Artem Russakovskii
on Stack Overflow
See other posts from Stack Overflow
or by Artem Russakovskii
Published on 2009-06-16T00:07:03Z
Indexed on
2010/06/16
11:32 UTC
Read the original article
Hit count: 210
After enabling strict warnings in PHP 5.2, I saw a load of strict standards warnings from a project that was originally written without strict warnings:
Strict Standards: Static function Program::getSelectSQL() should not be abstract in Program.class.inc
The function in question belongs to an abstract parent class Program and is declared abstract static because it should be implemented in its child classes, such as TVProgram.
I did find references to this change here:
Dropped abstract static class functions. Due to an oversight, PHP 5.0.x and 5.1.x allowed abstract static functions in classes. As of PHP 5.2.x, only interfaces can have them.
My question is: can someone explain in a clear way why there shouldn't be an abstract static function in PHP?
© Stack Overflow or respective owner