Решение 5 задачи
Primary tabs
<?php class Worker { public $name; public $age; public $salary; function __construct ($name,$age,$salary) { $this-> name = $name ; $this-> age = $age; $this-> salary = $salary; } function Getinfo () { return $this->name.$this-> age.$this-> salary." "; } function __destruct () { $this-> name; $this-> age; $this-> salary; } }$human = new Worker ('Ivan',27,1000); echo $human->Getinfo (); $human = new Worker ('Vasya',26,2000); echo $human->Getinfo ();?>
- Log in to post comments
- 1337 reads