3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Test { private $bridge; public function implement() { if (is_callable([parent,'implement'])){ parent::implement(); } echo $this->foo; } } class A { private $foo = 'bar'; private $final = 1; public function __construct() { $this->implement(); } public function foo() { echo $this->bridge; } } class B extends A { use Test; private $foo = 'baz'; } new B();

preferences:
43.64 ms | 402 KiB | 5 Q