Alain Roger schreef:
> Hi,
>
> i have the following classes:
> class A
> {
> public function EchoMe($txt)
> {
> echo $txt;
> }
> }
>
> class B extends A
> {
> ...
> }
>
> in theory i can write something like that:
>
> $b = new B();
> $b->EchoMe("test");
>
> and i should get echo "t
Using extends means that a class IS-A substructure of its parent class(es).
EXAMPLE:
class plant { };
class tree extends plant { };
class apple_tree extends tree { };
apple_tree inherits all methods and attributes from plant and tree
So if there was a methods plant->growth() you can also call it
Hi,
i have the following classes:
class A
{
public function EchoMe($txt)
{
echo $txt;
}
}
class B extends A
{
...
}
in theory i can write something like that:
$b = new B();
$b->EchoMe("test");
and i should get echo "test" on screen.
am i correct ?
--
Alain
---
3 matches
Mail list logo