Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- interface IRobot
- {
- const MODEL1 = "C3PO";
- const MODEL2 = "R2D2";
- const MODEL3 = "TERMINATOR";
- public function helpHuman();
- public function kill();
- public function translate();
- }
- class DarkBot implements IRobot
- {
- private $protocol = IRobot::MODEL1;
- private $astro = IRobot::MODEL2;
- private $terminate = IRobot::MODEL3;
- public function helpHuman()
- {
- return "$protocol: 'Oh dear, I am Afraid I cannot help Humans!' <br>";
- }
- public function kill()
- {
- return "$terminate: 'I would rather kill the humans!' <br> ";
- }
- public function translate()
- {
- return "$astro: 'Beep-boop' *with fire spitting from him*";
- }
- }
- $test = new DarkBot();
- echo $test->helpHuman();
- echo $test->kill();
- echo $test->translate();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement