3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace one; class DemoFile { protected bool $test = false; public function init(): void { $this->test = true; } } namespace two; class FirstChild extends one\DemoFile { } namespace two; class SecondChild extends FirstChild { protected bool $foo = false; public function init(): void { parent::init(); $this->foo = true; } }
Output for 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
Fatal error: Uncaught Error: Class "two\one\DemoFile" not found in /in/LeXsi:13 Stack trace: #0 {main} thrown in /in/LeXsi on line 13
Process exited with code 255.

preferences:
49.97 ms | 406 KiB | 5 Q