Re: RfC: rethink OO inheritance strictness

From: Date: Wed, 02 Aug 2006 17:02:32 +0000
Subject: Re: RfC: rethink OO inheritance strictness
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-25137@lists.php.net to get a copy of this message
At 18:22 02/08/2006, Pierre wrote:
On 8/2/06, Robert Cummings <robert@interjinn.com> wrote:
On Wed, 2006-08-02 at 16:07 +0200, Derick Rethans wrote:
On Wed, 2 Aug 2006, Zeev Suraski wrote:
My recommendation: - Add a new flag to methods (at the implementation level) that will allow to flag them as 'strict'
Have an example of what you mean here?
Maybe something like the following... <? class foo {
    function bleh( $p1, $p2 )
    {
        echo "Bleh: $p1, $p2\n";
    }
} class fee extends foo {
    loose function bleh( $p1 )
    {
        parent::bleh( $p1, $this->prop );
    }
} ?> I think I like it :D In this case,
Except that I would prefer the other way 'round. The default should be the "loose one".
Yes, that's what I originally meant. And as I mentioned, in my opinion that's not really all that necessary. Those who care about this kind of stuff will tend to have E_STRICT enabled and will fix it anyway. Zeev

« previous php.internals (#25137) next »