It sure is, but your code needs to look like this:

class one {
  function one() {
      echo "one ";
  }
 }
 
 class two extends one {
 function two() {
      parent::one();
      echo "two ";
 }
}
 
 class three extends two {
 function three() {
     parent::two();
     echo "three";
 }
}
 
$foo = new three();
-----------------------------------------------
Matty.


----- Original Message ----- 
From: "Andrew Kirilenko" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Sunday, June 24, 2001 6:04 AM
Subject: [PHP] OOP


> Hello!
> 
> Is it possible to do normal inheritance on PHP?
> I've following code:
> 
> --->
> 
> class one
> {
> function one()
> {
> echo "one ";
> }
> }
> 
> class two extends one
> {
> function two()
> {
> echo "two ";
> }
> }
> 
> class three extends two
> {
> function three()
> {
> echo "three";
> }
> }
> 
> $foo = new three();
> 
> <---
> 
> And the output of this programm is "three", but not "one two three" :(
> 
> Best regards,
> Andrew Kirilenko,
> Seniour Programmer / System Administrator,
> Internet Service.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to