3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL|E_STRICT); class Foo {} class Hoge { public function aaa(Foo $foo, $piyo) { var_dump($foo); } } class Bar extends Hoge { public function aaa($foo = null) { parent::aaa($foo, 'aaa'); } } $hoge = new Hoge(); $hoge->aaa(new Foo(), 'aaa'); $bar = new Bar(); $bar->aaa(new Foo());
Output for 7.0.0 - 7.2.0
Warning: Declaration of Bar::aaa($foo = NULL) should be compatible with Hoge::aaa(Foo $foo, $piyo) in /in/0EJ6s on line 21 object(Foo)#2 (0) { } object(Foo)#3 (0) { }
Output for 5.4.12 - 5.6.28
Strict Standards: Declaration of Bar::aaa() should be compatible with Hoge::aaa(Foo $foo, $piyo) in /in/0EJ6s on line 21 object(Foo)#2 (0) { } object(Foo)#3 (0) { }
Output for 5.3.22 - 5.3.29
Strict Standards: Declaration of Bar::aaa() should be compatible with that of Hoge::aaa() in /in/0EJ6s on line 21 object(Foo)#2 (0) { } object(Foo)#3 (0) { }