3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait A { private $whatever; } class B { use A; private $whatever; } trait C { private string $whatever = ''; } class D { use C; private $whatever; }
Output for 8.5.1 - 8.5.8
Fatal error: D and C define the same property ($whatever) in the composition of D. However, the definition differs and is considered incompatible. Class was composed in /in/Zr2aL on line 17 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.2.32, 8.3.5 - 8.3.32, 8.4.9 - 8.4.23
Fatal error: D and C define the same property ($whatever) in the composition of D. However, the definition differs and is considered incompatible. Class was composed in /in/Zr2aL on line 17
Process exited with code 255.

preferences:
58.44 ms | 528 KiB | 4 Q