Its really a difference of where its being used in the code.
For example, in a use statement, either can be used:
<?php
namespace Framework;
use Framework\Name;
// OR
use \Framework\Name;
// Both do the same thing
However, when you are actually in the code, not having the \ in the front of the namespace, will make the code look in the current namespace for the file. Example:
<?php
namespace Framework;
// ...
// The below will actually look for the class `\Framework\Framework\Name`
$class = new Framework\Name();
// However, this will look for, and hopefully find `\Framework\Name`
$class = new \Framework\Name();
This lets you do things like have a use statement on a subnamespace, and shorten your calls in the code: Example
<?php
namespace Framework;
use Framework\Cache;
class test {
public function __construct() {
// Below gets `\Framework\Cache\Memcache`
$memcache = new Cache\Memcache();
// Below gets `\Framework\Cache\Apc`
$apc = new Cache\Apc();
}
}
Hope this helps!