Since we already are in the namespace $ns, by using $class repeats the namespace : autoloader tries to load tests\fixtures\tests\fixtures\Foo instead of tests\fixtures\Foo