3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A {} class B extends A {} class Handler { public function handle(A $a) {} } class HandlerB extends Handler { public function handle(B $a) {} } $handlerA = new Handler(); $handlerB = new HandlerB(); $handlerA->handle(new A()); $handlerB->handle(new B());
Output for 7.0.28 - 7.3.0rc3
Warning: Declaration of HandlerB::handle(B $a) should be compatible with Handler::handle(A $a) in /in/i6uXQ on line 13
Output for 5.6.38
Strict Standards: Declaration of HandlerB::handle() should be compatible with Handler::handle(A $a) in /in/i6uXQ on line 13