3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Bar { private string $go; } class Foo { use Bar; function test() { $this->go = 'test'; echo $this->go; } } $foo = new Foo(); $foo->test();
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
test

preferences:
51.04 ms | 406 KiB | 5 Q