3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait T { private $x; } class C { use T; } $x=new \ReflectionClass(T::class); var_dump($x->getProperties());
Output for 7.4.33, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
array(1) { [0]=> object(ReflectionProperty)#2 (2) { ["name"]=> string(1) "x" ["class"]=> string(1) "T" } }

preferences:
93.41 ms | 404 KiB | 68 Q