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 { } trait C { private $foo; private function __init($foo) { $this->foo = $foo; } } $test = new B('bar'); print_r($test);

preferences:
35.34 ms | 402 KiB | 5 Q