note 128493 added to language.oop5.inheritance
| From: | max dot rabo at gmx dot net | Date: | Wed, 10 May 2023 16:32:45 +0000 |
| Subject: | note 128493 added to language.oop5.inheritance | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220448@lists.php.net to get a copy of this message | ||
class EBike extends Fahrzeug
{
private static $verfuegbar=0;
private $rahmengroesse;
public function __construct($kennz,$km,$rG)
{
parent::__construct($kennz,$km);
$this->rahmengroesse=$rG;
$this->abstandInspekt=5000;
if($this->rahmengroesse>26){$this->tagesPreis=30;}
else{$this->tagesPreis=20;}
self::$verfuegbar++;
}
public function getMietkosten($tage)
{
return $tage*$this->tagesPreis;
}
public static function getAnzahl()
{
return self::$verfuegbar;
}
}
/************************TEST*****************************/
require_once "fahrzeug.class.php";
require_once "ebike.class.php";
$ebike1= new EBike("MA-A-1",3600,28);
$ebike2= new EBike("MA-A-2",2600,26);
$ebike3= new EBike("MA-A-3",1600,24);
echo "Anzahl an E-Bikes: ".EBike::getAnzahl()."<br>";
echo $ebike1->vermieten();
echo $ebike1->vermieten();
echo $ebike1->zurueckgeben(1500);
echo $ebike1->getMietkosten(3);
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 2a02:810c:4cbf:f988:d03f:9ebb:1ed2:c0ba)
----
Manual Page -- https://php.net/manual/en/language.oop5.inheritance.php
Edit -- https://main.php.net/note/edit/128493
Del: integrated -- https://main.php.net/note/delete/128493/integrated
Del: useless -- https://main.php.net/note/delete/128493/useless
Del: bad code -- https://main.php.net/note/delete/128493/bad+code
Del: spam -- https://main.php.net/note/delete/128493/spam
Del: non-english -- https://main.php.net/note/delete/128493/non-english
Del: in docs -- https://main.php.net/note/delete/128493/in+docs
Del: other reasons-- https://main.php.net/note/delete/128493
Reject -- https://main.php.net/note/reject/128493
Search -- https://main.php.net/manage/user-notes.php