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; use one; 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

preferences:
45.09 ms | 406 KiB | 5 Q