3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NotFinal { protected function hello(boolean $bool = true) { echo 'hello'; } } final class ThisIsFinal() extends NotFinal{ public function hello(array $witharg) { return parent::hello(); } } $class = new ThisIsFinal(); $class->hello();
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/HaCI1 on line 4
Process exited with code 255.

preferences:
174.09 ms | 1395 KiB | 22 Q