3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Interfaze { public function hello($name); } class Clazz implements Interfaze { public function __construct() { $this->hello(); } public function hello($name) { echo "Hello, $name!"; } } class ClazzChild extends Clazz { public function __construct() { echo "Loaded from the child class."; parent::__construct(); } } $childclass = new ChildClazz; $childclass;
Output for 8.2.15 - 8.2.17, 8.3.2 - 8.3.4
Fatal error: Uncaught Error: Class "ChildClazz" not found in /in/C8Anj:27 Stack trace: #0 {main} thrown in /in/C8Anj on line 27
Process exited with code 255.
Output for 7.0.0 - 7.0.3, 7.0.6 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.3, 7.2.5 - 7.2.6, 7.2.8 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
Fatal error: Uncaught Error: Class 'ChildClazz' not found in /in/C8Anj:27 Stack trace: #0 {main} thrown in /in/C8Anj on line 27
Process exited with code 255.
Output for 5.6.5 - 5.6.6, 7.0.4 - 7.0.5, 7.2.4, 7.2.7

Process exited with code 137.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.4, 5.6.7 - 5.6.40
Fatal error: Class 'ChildClazz' not found in /in/C8Anj on line 27
Process exited with code 255.

preferences:
195.11 ms | 402 KiB | 248 Q