3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function __construct() { } } class Bar extends Foo { protected function __construct() { } }
based on M21Zu
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.6
Fatal error: Access level to Bar::__construct() must be public (as in class Foo) in /in/sm7gm on line 19
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Access level to Bar::__construct() must be public (as in class Foo) or weaker in /in/sm7gm:13 Stack trace: #0 {main}
Process exited with code 255.