<?php
trait Foo {
private $name = '123';
}
class Bar { use Foo;
private $name = '321';
public function getName(){echo $this->name;}
}
$bar = new Bar();
$bar->getName();
Fatal error: Bar and Foo define the same property ($name) in the composition of Bar. However, the definition differs and is considered incompatible. Class was composed in /in/hkN6g on line 5
Process exited with code 255.
Fatal error: Bar and Foo define the same property ($name) in the composition of Bar. However, the definition differs and is considered incompatible. Class was composed in /in/hkN6g on line 9
Process exited with code 255.