daily pastebin goal
89%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. interface Talker
  4. {
  5.   public function talk();
  6. }
  7.  
  8. class HelloTalker implements Talker
  9. {
  10.   private $_listener;
  11.  
  12.   public function __construct($listener)
  13.   {
  14.     $this->_listener = $listener;
  15.   }
  16.  
  17.   public function talk()
  18.   {
  19.     return sprintf('Hello %s!', $this->_listener);
  20.   }
  21. }
  22.  
  23. $hello = new HelloTalker('World');
  24.  
  25. echo $hello->talk();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top