Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- interface Talker
- {
- public function talk();
- }
- class HelloTalker implements Talker
- {
- private $_listener;
- public function __construct($listener)
- {
- $this->_listener = $listener;
- }
- public function talk()
- {
- return sprintf('Hello %s!', $this->_listener);
- }
- }
- $hello = new HelloTalker('World');
- echo $hello->talk();
Add Comment
Please, Sign In to add comment