Bug #69018 [Com]: Constants supported for A::A but not A::{'A'}
Edit report at https://bugs.php.net/bug.php?id=69018&edit=1
ID: 69018
Comment by: ajf at ajf dot me
Reported by: ajf at ajf dot me
Summary: Constants supported for A::A but not A::{'A'}
Status: Open
Type: Bug
Package: Scripting Engine problem
PHP Version: 5.6.5
Block user comment: N
Private report: N
New Comment:
...actually, I'm not sure A::{'A'} was ever valid syntax. I make mistakes, ignore me.
Previous Comments:
------------------------------------------------------------------------
[2015-02-09 16:17:51] ajf at ajf dot me
Er, the expected result was supposed to be this:
array(1) {
[0]=> string(1) "a"
}
Sorry about that.
------------------------------------------------------------------------
[2015-02-09 16:17:00] ajf at ajf dot me
Description:
------------
Compare:
http://3v4l.org/t6RG1
http://3v4l.org/6nmGV
Test script:
---------------
<?php
Class A { const A = ['a']; }
var_dump(A::{'A'});
Expected result:
----------------
Fatal error: Arrays are not allowed in class constants in %s on line %d
Actual result:
--------------
Fatal error: Arrays are not allowed in class constants in /in/t6RG1 on line 3
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69018&edit=1
Thread (4 messages)