ID:          43213
 Comment by:  carsten_sttgt at gmx dot de
 Reported By: uli dot staerk at globalways dot net
 Status:      Open
 Bug Type:    Scripting Engine problem
 PHP Version: 5.2.4
 New Comment:

You can found the answer here:
http://de.php.net/manual/en/reserved.php

| You cannot use any of the following words (PHP Keywords)
| as constants, class names, function or method names.
("array" is one of them)

Regards,
Carsten


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

[2007-11-07 16:09:10] uli dot staerk at globalways dot net

Description:
------------
You can define class constants like:
class foo {
    const bar = "baz";
}

But if the constant-name is array, it does not work.

Reproduce code:
---------------
<?php

class Test {
        const Array = "array";
}

?>

Expected result:
----------------
It should work ;)

Actual result:
--------------
Parse error: syntax error, unexpected T_ARRAY, expecting T_STRING in
test.php on line 4


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


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

Reply via email to