Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003233 [Quercus] minor always 01-09-09 07:50 01-12-09 09:53
Reporter haplo View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 4.0.0 Product Version
  Product Build
Summary 0003233: constant does not resovle ClassName::ConstantName
Description The method Evn.getConstantImpl does not resovle ClassName::ConstantName

Replacing Evn.getConstantImpl with the following method fixes the bug

    private Value getConstantImpl(String name) {
        Value value = _constMap.get(name);

        if (value != null)
            return value;

        value = _quercus.getConstant(name);
        if (value != null)
            return value;
        if (name.contains("::")){
            String[] splitName = name.split("::");
            if(splitName.length == 2 && _classMap.containsKey(splitName[0])){
                QuercusClass constantClass = _classMap.get(splitName[0]);
                value = constantClass.getConstant(this, splitName[1]);
            }
        }
        if(value != null){
            return value;
        }
        if (_lowerConstMap != null) {
            value = _lowerConstMap.get(name.toLowerCase());

            if (value != null)
                return value;
        }

        return null;
    }
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0003716)
nam
01-09-09 18:19
edited on: 01-09-09 18:22

php/09d0
php/39d0

Test case needed. This issue does not appear to exist on the trunk:

class A
{
  const FOO = "bar";
}

var_dump(A::FOO);

Quercus results:
string(3) "bar"

 
(0003720)
haplo
01-12-09 02:54

Hi,

but this should fail:

class A
{
  const FOO = "bar";
}

var_dump(constant("A::FOO"));
 
(0003721)
nam
01-12-09 09:53

php/0508
 

- Issue History
Date Modified Username Field Change
01-09-09 07:50 haplo New Issue
01-09-09 18:19 nam Note Added: 0003716
01-09-09 18:22 nam Note Edited: 0003716
01-12-09 02:54 haplo Note Added: 0003720
01-12-09 09:15 nam Status new => assigned
01-12-09 09:15 nam Assigned To  => nam
01-12-09 09:53 nam Status assigned => closed
01-12-09 09:53 nam Note Added: 0003721
01-12-09 09:53 nam Resolution open => fixed
01-12-09 09:53 nam Fixed in Version  => 4.0.0


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