Guest User

Untitled

a guest
May 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. <?php
  2.  
  3. $bird = new Parrot();
  4.  
  5. $bird->fly();
  6.  
  7. interface BirdInterface
  8. {
  9. public function fly();
  10. }
  11.  
  12. class Parrot implements BirdInterface
  13. {
  14. public function fly()
  15. {
  16. // ...fly away, Peter!
  17. }
  18. }
  19.  
  20. class Penguin implements BirdInterface
  21. {
  22. // ...don't fly
  23. }
Add Comment
Please, Sign In to add comment