There is a structure:
| - index.php | - test | classes |- someclass.php | traits |- sometrait.php And the code:
(Index.php - works)
<?php use \Test\Classes as Classes; use \Test\Traits as Traits; spl_autoload_register(...); echo Classes\Someclass::start(); ?> (Someclass.php)
<?php namespace Classes; // ^ не работает, но если я заменю "Classes" на "Test\Classes", то работает // Почему? Class Someclass { use Traits/Sometrait; // Да, не работает, но если я заменю "traits" на "Test\Traits" , то работает! // Почему? public static function start() {...} } ?> The fact is that the classroom namespace works only if you write Test\Classes full, not Classes , the same problem with traits: Traits do not work, but Test\Traits very even.