classes problem - am I being stupid?
| From: | kev | Date: | Wed, 13 Sep 2000 15:30:35 +0000 |
| Subject: | classes problem - am I being stupid? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-16567@lists.php.net to get a copy of this message | ||
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