3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { use C; public function __construct($foo) { $this->__init($foo); } } class B extends A { use C; } trait C { private $foo; private function __init($foo) { $this->foo = $foo; } } $test = new B('bar'); print_r($test);

preferences:
45.64 ms | 402 KiB | 5 Q