Posted by gosha bine on 05/25/07 08:18
On 25.05.2007 08:07 Ryan van Roode wrote:
> Hello,
>
> An API function gives me an object of class 'Blah'. I have subclassed
> 'Blah' and added a few methods:
>
> class EnhancedBlah extends Blah {
> function enhancement1() {}
> function enhancement2() {}
> }
>
> Is there a way to 'downcast' the object to a subclass? Something like
> this:
>
> $blah = SuperApi::getBlah();
> $enhancedBlah = (EnhancedBlah) $blah;
>
> Thanks for your help.
>
> ~RvR
>
Technically that's possible, see e.g. http://www.tagarga.com/blok/on/061130
but as others already said, the very idea is wrong.
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
[Back to original message]
|