It seems like you didn't read the whole RFC. The configuration is actually very simple (just the command line options), and not meant to be a front-facing HTTP server.
use \My\Namespace;
$var = new Namespace\MyClass();
$var->Foo();
I have to remember and type the parent namespace for every imported class I want to use. In a big project this gets to be too much typing and too much for my brain to remember. Contrast with say, C#: using My.Namespace;
MyClass var = new MyClass();
var.Foo();
You import a namespace, and the compiler figures out what goes where without you having to remember anything.Plus the weird exceptions required for backwards compatibility, and the global namespace: I often forget where a root \ is required and where it isn't (not when declaring a namespace, but often--not always!--when referencing one). And of course there's the monstrous choice of namespace separator.
End of the world? Not really. Sucks? Yeah. And possibly a dealbreaker for me for larger projects with complicated namespaces and lots of classes.
I'd love for this to be just a misunderstanding on my part, because it would make my life a lot easier if PHP namespaces where more like C# ones!
And a good read on PHP namespaces in general: http://weierophinney.net/matthew/archives/254-Why-PHP-Namesp...
$var = new MyClass();
This brings it pretty much in line with your C# example. Have you read the PHP docs on namespaces? namespace My {
class MyClass { public function Foo() { echo 'Foo'; } }
}
namespace {
use My\MyClass;
$var = new MyClass();
$var->Foo();
}At this point in the game, Apache-class servers are glorified proxies, and occasionally dole out static data when you're not using a CDN.
I have customized my web server so much, I would've had to wait for years to see the changes in Apache, nginx or lighty, if ever.