fork download
  1. <?php
  2.  
  3. /// parent class
  4. interface iA {
  5. public function execute($str = '');
  6. }
  7.  
  8. class A implements iA {
  9.  
  10. public function __construct() { }
  11.  
  12. public function execute($str = '')
  13. {
  14. return 'Execution ' . $str;
  15. }
  16. }
  17.  
  18. /// child class
  19. interface iB {
  20. public function execute($str = '');
  21. }
  22.  
  23. class B extends A implements iB {
  24.  
  25. public function __construct()
  26. {
  27. parent::__construct();
  28. }
  29.  
  30. public function execute($str = '')
  31. {
  32. return parent::execute();
  33. }
  34.  
  35. }
  36.  
  37. var_dump((new B)->execute());
Success #stdin #stdout 0.01s 52480KB
stdin
Standard input is empty
stdout
string(10) "Execution "