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.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
test

preferences:
58.62 ms | 838 KiB | 4 Q