Possible Duplicate:
What are namespaces?
from my understanding, name spaces allow you to have functions/variables with the same name inside different names spaces accross your scripts.
namespace productions\active;
class Slayer
{
function Username ()
{
$Username = "Test";
return $Username;
}
}
namespace productions\experimental;
class Slayer
{
function Username()
{
$Username = "Experiemental";
return $Username;
}
}
But what functionality does this provide?
Furthermore, what would happen if I have public functions inside my classes which “live” inside a namespace?
It would be obvious if you had to use two libraries with the same class names in the same project (yes, this may happen). With namespaces you can create alias for one of them, and use both without thouching library’s core.