ID:               27926
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jevon at jevon dot org
-Status:           Open
+Status:           Bogus
 Bug Type:         Feature/Change Request
 Operating System: XP SP1
 PHP Version:      5.0.0RC1
 New Comment:

Duplicate of bug #27022.


Previous Comments:
------------------------------------------------------------------------

[2004-04-08 20:43:06] jevon at jevon dot org

Description:
------------
It doesn't appear that you can change the access modifiers on constants
- are they public by default? It seems to make more sense to be able to
define access modifiers on constants (since you can with every other
component in classes). Consistency?

Reproduce code:
---------------
<?php
class Foo {
  const a = 1;
  public const b = 2;
  private const c = 3;

  static function bar() {
    return c;
  }
}

echo Foo::a;
echo Foo::b;
echo Foo::c;
echo Foo::bar();
?>

Expected result:
----------------
1
2
ERROR: Cannot access a private constant 'c'
3

Actual result:
--------------
Parse error: parse error, unexpected T_CONST, expecting T_VARIABLE in
C:\Web\construct\php\php5test\test10.php on line 4
PHP Parse error: parse error, unexpected T_CONST, expecting T_VARIABLE
in C:\Web\construct\php\php5test\test10.php on line 4 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27926&edit=1

Reply via email to