3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function setHandler($callable) { $callable(is_callable($callable)); } } class Bar extends Foo { public function setHandler(callable $callable) { parent::setHandler($callable); } } $bar = new Bar(); $bar->setHandler('var_dump');
Output for 7.0.0 - 7.2.0
Warning: Declaration of Bar::setHandler(callable $callable) should be compatible with Foo::setHandler($callable) in /in/hv5Oi on line 15 bool(true)
Output for 5.4.2 - 5.6.28
Strict Standards: Declaration of Bar::setHandler() should be compatible with Foo::setHandler($callable) in /in/hv5Oi on line 15 bool(true)
Output for 5.3.18 - 5.3.29
Strict Standards: Declaration of Bar::setHandler() should be compatible with that of Foo::setHandler() in /in/hv5Oi on line 15 Catchable fatal error: Argument 1 passed to Bar::setHandler() must be an instance of callable, string given, called in /in/hv5Oi on line 18 and defined in /in/hv5Oi on line 12
Process exited with code 255.