php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47068 Parse error if global namespace resolution is used
Submitted: 2009-01-11 15:20 UTC Modified: 2009-01-11 16:52 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ninzya at inbox dot lv Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.0alpha3 OS: Windows XP
Private report: No CVE-ID: None
 [2009-01-11 15:20 UTC] ninzya at inbox dot lv
Description:
------------
See details below

Reproduce code:
---------------
index.php:

 1: <?php
 2: 
 3: class Test {
 4:   public static function Fn() {
 5:     return 'Passed';
 6:   }
 7: }
 8: 
 9: echo ::Test::Fn();
10: 
11: ?>

Expected result:
----------------
Passed

Actual result:
--------------
Parse error: parse error in D:\WebServer\PHP-5.3a3\index.php on line 9

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-11 15:21 UTC] ninzya at inbox dot lv
This used to work in PHP 5.3.0alpha2
 [2009-01-11 16:20 UTC] felipe@php.net
Hi,
the namespace separator was changed to \.
http://docs.php.net/manual/en/language.namespaces.basics.php
 [2009-01-11 16:52 UTC] ninzya at inbox dot lv
A BACKSLASH? FAIL. That's very very BAD idea. The code has become NOT readable, it looks like HDD DISK DUMP, FILE LIST, CRAP. It would be good if you change your mind about NS separator before releasing 5.3.0 and leave "::" as ns sep., or at least pick dot (".") or something, NOT BACKSLASH.

I suggest you less chatting with your collegues and more chat with people when deciding about things like namespace separators. I have read your wiki, where devs suggest ":)", "^^", "**", "%%" as separators - that's not serious. What's wrong with "::"? Why it was necessary to change it to something like backslash? Backslash is the last thing u should implement in this case.

I'm completely not comfortable with use of backslash as separator, and 100% of other people i guess too.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 23:01:33 2025 UTC