3v4l.org

run code in 300+ PHP versions simultaneously
<?php class questions { public function index( $one = '', $two = '', $three = '' ) { return 'sth'; } } class tags extends questions { public function index () { return parentClass::index(); } } $obj = new tags; echo $obj->index();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
Fatal error: Declaration of tags::index() must be compatible with questions::index($one = '', $two = '', $three = '') in /in/hRBhT on line 13
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Warning: Declaration of tags::index() should be compatible with questions::index($one = '', $two = '', $three = '') in /in/hRBhT on line 13 Fatal error: Uncaught Error: Class 'parentClass' not found in /in/hRBhT:14 Stack trace: #0 /in/hRBhT(20): tags->index() #1 {main} thrown in /in/hRBhT on line 14
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33
Warning: Declaration of tags::index() should be compatible with questions::index($one = '', $two = '', $three = '') in /in/hRBhT on line 17 Fatal error: Uncaught Error: Class 'parentClass' not found in /in/hRBhT:14 Stack trace: #0 /in/hRBhT(20): tags->index() #1 {main} thrown in /in/hRBhT on line 14
Process exited with code 255.

preferences:
157.36 ms | 410 KiB | 5 Q