You can't override the method signature in subclasses in PHP5.
If you want this in PHP6, research the ...discusssion... from last
month on this topic on the PHP-Internals mailing list, and weigh in if
it's not already a Dead Horse.
I recall the ...discussion... more for entertainment value than a
> > Hi Richard,
> >
> > This is very strange. I can certainly reproduce the problem. Putting a
> > var_dump($this) in ClassA's save method shows that PHP sees $this as an
> > instance of ClassB - when it should be of ClassA.
>
> what *you* think it should be and what php's developers decided
> it s
> -Original Message-
> From: Richard Morris [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 06, 2006 10:22 AM
> To: php-general@lists.php.net
> Subject: [PHP] PHP5 Inheritance/method override problem
>
> Hi,
>
> I came across this problem and I was wo
Edward Kay wrote:
> Hi Richard,
>
> This is very strange. I can certainly reproduce the problem. Putting a
> var_dump($this) in ClassA's save method shows that PHP sees $this as an
> instance of ClassB - when it should be of ClassA.
what *you* think it should be and what php's developers decided
Hi Richard,
This is very strange. I can certainly reproduce the problem. Putting a
var_dump($this) in ClassA's save method shows that PHP sees $this as an
instance of ClassB - when it should be of ClassA.
I'm afraid it's stumped me too! Does anyone else have any thoughts?
Edward
> Hi,
>
> I ca
# [EMAIL PROTECTED] / 2006-12-06 07:22:22 -0800:
> Basically I have one class that performs a certain task. I then have a
> second class which extends the first class and performs some tasks in
> addition to the first class. Even though ClassA should know nothing
> about ClassB since ClassA is
Hi,
I came across this problem and I was wondering if someone might be able
to explain to my why it is happening. I put together a short example to
illustrate the problem that I am having.
Basically I have one class that performs a certain task. I then have a
second class which extends th
7 matches
Mail list logo