3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface a { public function aaa(); } interface b extends a { public function bbb(); } class aa implements a { public function aaa() { echo 'aa'; } } class bb implements b { public function aaa() { echo 'aa'; } public function bbb() { echo 'bb'; } } echo 'aa' . "\n"; echo 'aa:aaa' . "\n"; $aa = new aa(); $aa->aaa() . "\n"; echo "\n\n"; echo 'bb' . "\n"; $bb = new bbb(); echo 'bb:aa' . "\n"; $bb->aaa() . "\n"; echo 'bb:bb' . "\n"; $bb->bbb();
based on ZEABf
Output for 7.0.0 - 7.2.0
aa aa:aaa aa bb Fatal error: Uncaught Error: Class 'bbb' not found in /in/F2tMG:37 Stack trace: #0 {main} thrown in /in/F2tMG on line 37
Process exited with code 255.
Output for 5.3.19 - 5.6.28
aa aa:aaa aa bb Fatal error: Class 'bbb' not found in /in/F2tMG on line 37
Process exited with code 255.