Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003972 [Quercus] crash always 03-29-10 09:37 01-05-11 08:57
Reporter rodchyn View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 4.0.5
  Product Build
Summary 0003972: Namespace error
Description There are no way to write code with namespaces.
Code that throw error.

namespace identifier is not allowed at '\DomElement' in

static public function convertDomElementToArray(\DomElement $element)
{

}
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0004494)
rodchyn
03-29-10 09:56

I mean that I can't add global classes when passing type hint to function arguments.

In other places global classes work fine.
 
(0004888)
Craige
01-05-11 06:42

Considering nobody has looked at this in 9 months, I took a look into the source.

quercus/com/caucho/quercus/parser/QuercusParser.java line 4468 - 4475

    if (_lexeme.indexOf('\\') >= 0) {
      throw error(L.l("namespace identifier is not allowed at '{0}'",
                      _lexeme));
    }
    else if (_peek == '\\') {
        throw error(L.l("namespace identifier is not allowed at '{0}\\'",
                        _lexeme));
    }

It seems Quercus is explicitly disallowing referencing the global namespace, but I could be wrong. This was just a 5 min dig into the source. I'm going to dig further into it and see if I can dig up/patch the problem, but I'm not really a Quercus developer.
 
(0004889)
Craige
01-05-11 08:57

Upon further digging, it appears that `parseFunctionArgDefinition()` is calling `parseIdentifier()`, which does allow namespaced identifiers. In this particular context, a namespaced identifier is perfectly valid, and thus `parseNamespacedIdentifier()` is the method that should be called.

I have a feeling this is a legacy problem from when PHP 5.3 introduced namespaces. I'm going to see if I can set up a proper dev environment ant patch this is the next few days.
 

- Issue History
Date Modified Username Field Change
03-29-10 09:37 rodchyn New Issue
03-29-10 09:56 rodchyn Note Added: 0004494
01-05-11 06:42 Craige Note Added: 0004888
01-05-11 08:57 Craige Note Added: 0004889
01-01-11 07:23 kdecherf Issue Monitored: kdecherf


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
35 total queries executed.
29 unique queries executed.
Powered by Mantis Bugtracker