| Server IP : 109.234.162.214 / Your IP : 216.73.216.222 Web Server : Apache System : Linux servd162214.srv.odns.fr 4.18.0-372.26.1.lve.1.el8.x86_64 #1 SMP Fri Sep 16 14:08:19 EDT 2022 x86_64 User : carpe ( 1178) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/carpe/public_html/MuletVsFondation/ |
Upload File : |
<?php
class Vaisseau{
public $nom;
public $etat_technique;
public $etat_proprete;
public function __construct($n,$t,$p){
$this->nom = $n;
$this->etat_technique = $t;
$this->etat_proprete = $p;
}
public function toArray() {
return [
'nom' => $this->nom,
'etat_technique' => $this->etat_technique,
'etat_proprete' => $this->etat_proprete,
];
}
public function etat_technique(){
return $this->etat_technique;
}
public function etat_proprete(){
return $this->etat_proprete;
}
public function sePresenter(){
echo "Vaisseau {$this->nom}, etat technique : {$this->etat_technique}%, etat propreté : {$this->etat_proprete}%";
if($this->etat_proprete > 80 AND $this->etat_technique > 90 ){
echo "Le vaisseau peut décoller !";
}
}
}
$vaisseaux = [
new Vaisseau("Aurora",30,20),
new Vaisseau("Spectrus",80,10)
];
?>