Re: classes problem - am I being stupid?
| From: | Frederico Augusto Costa | Date: | Wed, 13 Sep 2000 14:47:27 +0000 |
| Subject: | Re: classes problem - am I being stupid? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16574@lists.php.net to get a copy of this message | ||
Nothing, I've got the following output:
----
This is c1::func1
This is c2::func1
---
[]'s
------------------------
Frederico Augusto Costa
facosta@magnux.com.br
------------------------
On Wed, 13 Sep 2000, kev wrote:
> Hi,
>
> Please take a look at the following short piece of code:
>
> --- Start ---------
>
> <?
> class c1
> {
> function c1()
> {
> }
> function func1()
> {
> echo "This is c1::func1<BR>";
> }
> function func2()
> {
> echo "This is c1::func2<BR>";
> }
> }
>
> class c2 extends c1
> {
> function c2()
> {
> }
> function func1()
> {
> echo "This is c2::func1<BR>";
> }
> function func2()
> {
> echo "This is c2::func2<BR>";
> }
> }
>
> $c1 = new c1();
> $c1->func1();
>
> $c2 = new c2();
> $c2->func1();
> ?>
> --- End ------------
>
> ... and please tell me why it gives this output:
>
> This is c1::func1
>
> ... instead of this output:
>
> This is c1::func1
>
> This is c2::func1
>
> Sorry if I've done something dumb, but I've stared at it long enough and can't
> see
>
> what's wrong!
>
> thanks,
>
> - Kev
>
> --
> http://www.fa-premier.com - English Premier League Football
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>