3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract class class1 { abstract public function method1($arg1); public function method2($arg1) { var_dump(func_get_args()); } } class class2 extends class1 { public function method1($arg1, $arg2) { var_dump(func_get_args()); } public function method2($arg1, $arg2) { var_dump(func_get_args()); } } $obj = new class2; $obj->method1(); $obj->method2();
Output for 5.4.0 - 5.4.19
Fatal error: Declaration of class2::method1() must be compatible with class1::method1($arg1) in /in/mpLCS on line 23
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Fatal error: Declaration of class2::method1() must be compatible with that of class1::method1() in /in/mpLCS on line 23
Process exited with code 255.