All Posts Tagged With: "WTF"

WTF - PHP to use backslash as namespace separator

Are you serious?

It apparently was confirmed on Saturday that PHP’s namespace separator will be a backslash.

Not only does this fly in the face of every coding standard ( and established language ), it’s idiotic. Why not adopt the Java import standard? Instead of something akin to:

require "PDO/mysql.php";

$object = PDO\Mysql("arg");

You would have:

require php.pdo.mysql;

$object = Mysql("arg");

For runtime or static namespacing, you could just use the full namespace:

$object = php.pdo.mysql("arg");

But no, after a “lengthy” IRC discussion, they’ve decided to subject us to this:

$object = Some\stupidly\long\name\space("hi");

One concern with using something like :: or -> is that it was used elsewhere, and \ wasn’t. Oh wait, except for escaping something.

Honestly, after using Python and Java more, I’m rarely even use PHP. Namespaces was something that would have brought me back to the fold, but I’m not interested in using the retarded backslash separator. After nine years of programming in PHP, I think I’m ready to hang up the hat and move on to something better, faster, and more standard.

Tags: ,