<?php

trait T
{
    private $x = 0;
}
class X
{
    use T;
}
class Y extends X
{
    use T;
    function __construct()
    {
        return ++$this->x;
    }
}
class Z extends Y
{
    function __construct()
    {
        return ++$this->x;
    }
}
$a = new Z();
$a->__construct();
echo "DONE";
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     $this->useOption = true;
 }