php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46943 Namespace separator
Submitted: 2008-12-26 13:31 UTC Modified: 2008-12-26 13:39 UTC
From: hostit at mail dot ru Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.3.0alpha3 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hostit at mail dot ru
New email:
PHP Version: OS:

 

 [2008-12-26 13:31 UTC] hostit at mail dot ru
Description:
------------
Hello.

As you might know a fairly large amount of PHP developers think that backslash (\) is an inappropriate symbol for namespace separator. [http://blogsearch.google.com/blogsearch?hl=en&q=php%20namespace%20separator&um=1&ie=UTF-8&sa=N&tab=wb]

Two main reasons are:
1. It's ugly. (Indeed.)
2. Confusion with escaping.

As the roar strengthens, it's starting to appear that it might be one of the nails in the PHP coffin. Just look at the amount of FUD spread  because of this damned backslash...

For us, the PHP developers, it's very dangerous tendency, because we have invested a lot of our time (read: money) into PHP software.

Please, please, PLEASE reconsider that. I understand the problems with  "::", but I think there can be a solution - to throw fatal error when there's a conflict between static method name and the function in a namespace. (You can't declare two functions/classes with the same name, can you? And it is logical and expected behavior.) I'm sure it will make PHP programmers happy.

As it's still alpha, the change is possible. And the mistake in the design of the language will remain forever after the release.


THANK YOU!

Reproduce code:
---------------
\This\is::ugly()

Expected result:
----------------
::This::looks::better()

Actual result:
--------------
\This\is::ugly()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-26 13:39 UTC] johannes@php.net
Believe me, we invested time (=mone, according to your equation) into PHP, too :-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 09:01:33 2024 UTC