← Home

Access level constrains in php5 really suck

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.

blog comments powered by Disqus