2 Classes inheritance test
6 /* Inheritance test. Pretty nifty if I do say so myself! */
12 echo "This is class foo\n";
13 echo "a = ".$this->a."\n";
14 echo "b = ".$this->b."\n";
17 return $this->a*$this->b;
21 class bar extends foo {
23 function display() { /* alternative display function for class bar */
24 echo "This is class bar\n";
25 echo "a = ".$this->a."\n";
26 echo "b = ".$this->b."\n";
27 echo "c = ".$this->c."\n";
36 echo $foo1->mul()."\n";
45 echo $bar1->mul()."\n";