3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait T { protected $value = "T"; } class C { use T; protected $value = "C"; public function getC() { return $this->value; } } $c = new C(); echo $c->getC();
Output for 7.0.0 - 7.2.0
Fatal error: C and T define the same property ($value) in the composition of C. However, the definition differs and is considered incompatible. Class was composed in /in/lnFCM on line 8
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: C and T define the same property ($value) in the composition of C. However, the definition differs and is considered incompatible. Class was composed in /in/lnFCM on line 18
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_STRING in /in/lnFCM on line 3
Process exited with code 255.