Re: [patch] Callbacks bug/change request

From: Date: Sat, 02 Jun 2007 08:44:32 +0000
Subject: Re: [patch] Callbacks bug/change request
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-30038@lists.php.net to get a copy of this message
Stanislav Malyshev wrote: >> You'd probably do something along those lines if it were possible: >> >> ((ParentClass) $child)->virtualMethod(); > > Looks like bad style to me - why not call child's method and it would, > if needed, pass control to parent? yeah, although I could imagine a situation where your stuck needing to calling parent::method() it smells like bad OO - the same kind of bad smell that people have been told they should avoid when it comes to wanting static interface methods, function signature changing, etc. personally I don't mind the smells, I'm not from the straight-jacket OO side of the street. that said I do feel consistency is a worthy goal and therefore it seems correct to enforce straight-jackets all round - given the general direction/mindset of php's OO functionality it seems that calling parent::method() from outside the relevant $child->method() should be illegal inline with other 'strictness enforcements'. >

« previous php.internals (#30038) next »