fork download
  1. <?php
  2. function m(Bar $x) {
  3. $x->m('Error Processing Request', 10, 1000000000);
  4. }
  5. class Bar {
  6. public function m($message, $code, $timer) {
  7. echo "Bar\n";
  8. var_dump($message, $code, $timer);
  9. }
  10. }
  11. class Foo extends Bar {
  12. public function m($message) {
  13. echo "Foo\n";
  14. parent::m($message, 0, time());
  15. }
  16. }
  17. m(new Foo);
  18.  
  19. //https://pt.stackoverflow.com/q/174414/101
Success #stdin #stdout #stderr 0.03s 24456KB
stdin
Standard input is empty
stdout
Foo
Bar
string(24) "Error Processing Request"
int(0)
int(1585919733)
stderr
PHP Warning:  Declaration of Foo::m($message) should be compatible with Bar::m($message, $code, $timer) in /home/sZQKq1/prog.php on line 16