note 123874 deleted from language.oop5.decon by cmb

From: Date: Wed, 22 May 2019 17:59:32 +0000
Subject: note 123874 deleted from language.oop5.decon by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211105@lists.php.net to get a copy of this message
Note Submitter: dostroem at gmx dot de ---- 419/5000 <? Php abstract class vehicle { protected $hourlyrate; protected $ identifier; protected $ functional; public function __construct ($ knz) { $ This-> mark = $ knz; $ This-> funcff = TRUE; } public function set hourly rate ($ sp) { $ This-> hours price = $ sp; } public function hourly price () { return $ this-> hourly rate; } public function setFunction ($ ff) { $ This-> funcff = $ ff; } } ?> <? Php require_once "test.php"; class car extends vehicle { private static $ existed; private $ trailer hitch; public function __construct ($ knz, $ ak) { parent :: __ construct ($ knz); $ This-> trailer hitch = $ ak; self :: $ consisted ++; } borrow public function () { if (self :: $existed > = 1) { self :: $ existed --; } } public function return () { if ($ this-> funcff == TRUE) { self :: $ existed ++; } } public function outputPKWData () { echo "<h1> Car data with the indicator:". $ this-> identifier. "</ h1>"; echo "Current Hourly Price:". $ this-> getHour Price (). "Euro. <br>"; if ($ this-> funcff == TRUE) { echo "vehicle is <b> functional </ b> <br>"; } else { echo "vehicle is not <b> functional </ b> <br>"; } if ($ this-> trailer hitch == TRUE) { echo "trailer hitch is available <br>"; } else { echo "trailer hitch is not available <br>"; } } public static function existEdit () { echo "<p>". self :: $ existed. "Car available </ p>"; } } ?> if (isset ($ _ GET [ 'send'])) { if (isset ($ _ GET [ "at"])) { $ A = TRUE; } elseif ($ _ GET ["ab"]) { $ A = FALSE; } require_once "abpkw.php"; $ pkw1 = new car ($ _ GET ["knz"], $ a); $ Pkw1-> setStundenpreis ($ _ GET [ "sp"]); $ Pkw1-> ausgabePKWDaten (); PKW:: consisted print (); $ Pkw1-> borrow (); PKW :: consisted print (); $ Pkw1-> borrow (); Bus :: consisted print (); // $ pkw1-> setFunktionsfaehig (FALSE); //to check $ Pkw1-> back () function; // $ pkw1-> setFunktionsfaehig (FALSE); //to check PKW :: consisted print (); } ?>

« previous php.notes (#211105) next »