3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class TestClass{ abstract protected function test(); } class NewClass extends TestClass{ private function test(){ echo "hello"; } } $newclass = new NewClass(); $newclass->test();
based on FPhHl
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.6
Fatal error: Access level to NewClass::test() must be protected (as in class TestClass) or weaker in /in/MBJcM on line 13
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Access level to NewClass::test() must be protected (as in class TestClass) or weaker in /in/MBJcM:8 Stack trace: #0 {main}
Process exited with code 255.