3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class lol { private function __construct() {} private function asdf() { echo "hello"; } } class rofl extends lol { public function __construct() { echo "hi"; } public function asdf(){ parent::asdf(); } } (new rofl())->asdf();
based on A4WqK
Output for 7.0.0 - 7.2.6
hi Fatal error: Uncaught Error: Call to private method lol::asdf() from context 'rofl' in /in/Bjefa:16 Stack trace: #0 /in/Bjefa(20): rofl->asdf() #1 {main} thrown in /in/Bjefa on line 16
Process exited with code 255.
Output for hhvm-3.15.4
hi Fatal error: Uncaught Error: Call to private method lol::asdf() from context 'rofl' in /in/Bjefa:16 Stack trace: #0 /in/Bjefa(20): rofl->asdf() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
hi Fatal error: Call to private method lol::asdf() from context 'rofl' in /in/Bjefa on line 16
Process exited with code 255.