News for hackers. Stuff that matters.
Re:A Built-in Web Server For PHP by ary on Wednesday March 02, 2011 @08:16PM (#2282259)
Your PHP example is possible to write in a way that is nearly identical to the C# you provided. Why are you prefixing Namespace\MyClass(); when you declared your namespace scope in 'use \My\Namespace'? Your assignment can just be:

  $var = new MyClass();
This brings it pretty much in line with your C# example. Have you read the PHP docs on namespaces?

http://www.php.net/manual/en/language.namespaces.basics.php

Re:A Built-in Web Server For PHP by acabal on Wednesday March 02, 2011 @08:38PM (#2282306)
That's the point; the PHP doesn't compile without the namespace prefix. In fact I just tried it to make sure I'm remembering right.
Re:A Built-in Web Server For PHP by ary on Wednesday March 02, 2011 @09:47PM (#2282514)
I was taken aback when I tested this for myself as my initial reading of the PHP docs lead me to a very different conclusion. You are indeed correct, and in my opinion that is very broken. Touché.