note 113412 added to language.oop5.decon
| From: | NanheKumar | Date: | Tue, 08 Oct 2013 11:09:31 +0000 |
| Subject: | note 113412 added to language.oop5.decon | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196494@lists.php.net to get a copy of this message | ||
<?php
// This program uses inheritance to extend Box.
class Box {
public $width;
public $height;
public $depth;
// construct
public function __construct($width = NULL, $height = NULL, $depth = NULL) {
$this->width = $width;
$this->height = $depth;
$this->depth = $height;
}
public function volume() {
return $this->width * $this->height * $this->depth;
}
}
class BoxWeight extends Box {
public $weight; // weight of box
public function __construct($width = NULL, $height = NULL, $depth = NULL, $weight = NULL) {
parent::__construct($width, $height, $depth);
}
}
$bw = new BoxWeight(10, 20, 15, 34.3)
?>
----
Server IP: 69.147.83.199
Probable Submitter: 210.7.74.130
----
Manual Page -- http://php.net/manual/en/language.oop5.decon.php
Edit -- https://master.php.net/note/edit/113412
Del: integrated -- https://master.php.net/note/delete/113412/integrated
Del: useless -- https://master.php.net/note/delete/113412/useless
Del: bad code -- https://master.php.net/note/delete/113412/bad+code
Del: spam -- https://master.php.net/note/delete/113412/spam
Del: non-english -- https://master.php.net/note/delete/113412/non-english
Del: in docs -- https://master.php.net/note/delete/113412/in+docs
Del: other reasons-- https://master.php.net/note/delete/113412
Reject -- https://master.php.net/note/reject/113412
Search -- https://master.php.net/manage/user-notes.php