fork download
  1. <?php
  2. class material
  3. {
  4. private $material;
  5.  
  6. public function setMaterial($material)
  7. {
  8. $this->material = $material;
  9. }
  10.  
  11. public function getMaterial()
  12. {
  13. return $this->material;
  14. }
  15. }
  16.  
  17. $m = new material();
  18. $m->setMaterial('drewno');
  19.  
  20. echo $m->getMaterial().PHP_EOL; // drewno
  21.  
  22. $m->setMaterial('mosiądz');
  23.  
  24. echo $m->getMaterial(); // mosiądz
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
drewno
mosiądz