3v4l.org

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