Access level constrains in php5 really suck
posted: January 4th, 2006 · by: Sven
I can’t understand why I’m being forced to keep the access level of a class’s method when I extend it.
class SomeFactory extends PEAR_Delegator {
protected function __construct() {
}
public static function instance() {
}
}
... would make perfectly sense IVHMO. But it throws …
"Fatal error: Access level to ActivePdo_Relation::__construct() must be public (as in class PEAR_Delegator)"
What’s the reasoning behind this?
That’s because I’m “doing something terribly wrong”, is it? Not the “php way”? Boy, this sucks.
Interested Party said January 12th, 2007 at 10:41 AM ¶
What are your opinions of PEAR_Delegator?
Sven said January 26th, 2007 at 08:51 AM ¶
I believe it's a highly useful package. :)
I've been talking to the developer at that time and came to the opinion that he really knows what he's doing.
Unfortunately the package doesn't seem to be maintained that active - "0.1.0 (alpha) was released on 2005-04-10" according to http://pear.php.net/package/PEAR_Delegator
So there doesn't seem to be that much demand either.