Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <?php
  2. interface IRobot
  3. {
  4. const MODEL1 = "C3PO";
  5. const MODEL2 = "R2D2";
  6. const MODEL3 = "TERMINATOR";
  7.  
  8. public function helpHuman();
  9. public function kill();
  10. public function translate();
  11. }
  12. class DarkBot implements IRobot
  13. {
  14. private $protocol = IRobot::MODEL1;
  15. private $astro = IRobot::MODEL2;
  16. private $terminate = IRobot::MODEL3;
  17.  
  18. public function helpHuman()
  19. {
  20. return "$protocol: 'Oh dear, I am Afraid I cannot help Humans!' <br>";
  21. }
  22.  
  23. public function kill()
  24. {
  25. return "$terminate: 'I would rather kill the humans!' <br> ";
  26. }
  27. public function translate()
  28. {
  29. return "$astro: 'Beep-boop' *with fire spitting from him*";
  30. }
  31. }
  32. $test = new DarkBot();
  33. echo $test->helpHuman();
  34. echo $test->kill();
  35. echo $test->translate();
  36.  
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement