3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { use Some; function bar () { echo "this is bar" . PHP_EOL; } } trait Some { function useBar() { echo "using parent bar function" . PHP_EOL; $this->bar(); } } (new Foo())->useBar();
Output for 8.1.10 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
using parent bar function this is bar

preferences:
68.54 ms | 402 KiB | 28 Q