3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); ini_set('display_errors',1); class foo { public function do_something ($str) { echo($str); } public function print_string ($str) { $this->do_something($str); } } class bar extends foo { public function do_something () { echo('baz'); } } $b=new bar(); $b->do_something(); $b->print_string('foo'); ?>
Output for 7.0.0 - 7.2.0
Warning: Declaration of bar::do_something() should be compatible with foo::do_something($str) in /in/3v6XY on line 30 bazbaz
Output for 5.4.10 - 5.6.21
Strict Standards: Declaration of bar::do_something() should be compatible with foo::do_something($str) in /in/3v6XY on line 30 bazbaz
Output for 5.3.20 - 5.3.29
Strict Standards: Declaration of bar::do_something() should be compatible with that of foo::do_something() in /in/3v6XY on line 30 bazbaz