3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class Foo { public function foo() { } } class Bar extends Foo { protected function foo() { } }
based on M21Zu
Output for 7.0.0 - 7.1.6
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in /in/7fZvY on line 3 Fatal error: Access level to Bar::foo() must be public (as in class Foo) in /in/7fZvY on line 19
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Access level to Bar::foo() must be public (as in class Foo) or weaker in /in/7fZvY:13 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Access level to Bar::foo() must be public (as in class Foo) in /in/7fZvY on line 19
Process exited with code 255.