3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Interfaze { public function hello($name); public function getName(); } class ParentClazz implements Interfaze { public function __construct($name) { $this->hello($name); } public function hello($name) { echo "Hello, $name!\n"; } } class ChildClazz extends ParentClazz { public function __construct($name) { echo "Loaded from the child class.\n"; parent::__construct($name); } } $childclass = new ChildClazz("Payton");
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Class ParentClazz contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Interfaze::getName) in /in/J3vJb on line 9
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.7 - 5.6.28
Fatal error: Class ParentClazz contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Interfaze::getName) in /in/J3vJb on line 18
Process exited with code 255.

preferences:
207.18 ms | 402 KiB | 243 Q