3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MyTrait { /** * Comes from trait */ private $foo; } class MyClass { use MyTrait; /** * Comes from class */ private $foo; } $classFoo = new \ReflectionProperty('MyClass', 'foo'); $traitFoo = new \ReflectionProperty('MyTrait', 'foo'); var_export($traitFoo->getDocComment() == $classFoo->getDocComment());
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
false
Output for 5.6.0 - 5.6.40
Strict Standards: MyClass and MyTrait define the same property ($foo) in the composition of MyClass. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed in /in/uJA3s on line 19 false

preferences:
152.25 ms | 407 KiB | 5 Q