3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class NotFinal { protected function hello($string = '' ) { echo 'hello'; } } final class ThisIsFinal extends NotFinal { public function hello(array $witharg) { return parent::hello(); } } $class = new ThisIsFinal(); $class->hello([]);
based on OZ7W6
Output for 7.0.0 - 7.2.0
Warning: Declaration of ThisIsFinal::hello(array $witharg) should be compatible with NotFinal::hello($string = '') in /in/Hb9Om on line 13 hello
Output for 5.4.9 - 5.6.28
Strict Standards: Declaration of ThisIsFinal::hello() should be compatible with NotFinal::hello($string = '') in /in/Hb9Om on line 13 hello
Output for 5.3.19 - 5.3.29
Strict Standards: Declaration of ThisIsFinal::hello() should be compatible with that of NotFinal::hello() in /in/Hb9Om on line 13 Parse error: syntax error, unexpected '[', expecting ')' in /in/Hb9Om on line 16
Process exited with code 255.