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 HaCI1
Output for 7.1.0 - 7.2.0
Warning: Declaration of ThisIsFinal::hello(array $witharg) should be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 13 Fatal error: Uncaught ArgumentCountError: Too few arguments to function ThisIsFinal::hello(), 0 passed in /in/OZ7W6 on line 16 and exactly 1 expected in /in/OZ7W6:10 Stack trace: #0 /in/OZ7W6(16): ThisIsFinal->hello() #1 {main} thrown in /in/OZ7W6 on line 10
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Declaration of ThisIsFinal::hello(array $witharg) should be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 13 Fatal error: Uncaught TypeError: Argument 1 passed to ThisIsFinal::hello() must be of the type array, none given, called in /in/OZ7W6 on line 16 and defined in /in/OZ7W6:10 Stack trace: #0 /in/OZ7W6(16): ThisIsFinal->hello() #1 {main} thrown in /in/OZ7W6 on line 10
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Strict Standards: Declaration of ThisIsFinal::hello() should be compatible with NotFinal::hello($string = '') in /in/OZ7W6 on line 13 Catchable fatal error: Argument 1 passed to ThisIsFinal::hello() must be of the type array, none given, called in /in/OZ7W6 on line 16 and defined in /in/OZ7W6 on line 10
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Strict Standards: Declaration of ThisIsFinal::hello() should be compatible with that of NotFinal::hello() in /in/OZ7W6 on line 13 Catchable fatal error: Argument 1 passed to ThisIsFinal::hello() must be an array, none given, called in /in/OZ7W6 on line 16 and defined in /in/OZ7W6 on line 10
Process exited with code 255.