Bug #69018 [Opn->Nab]: Constants supported for A::A but not A::{'A'}

From: Date: Mon, 09 Feb 2015 16:44:07 +0000
Subject: Bug #69018 [Opn->Nab]: Constants supported for A::A but not A::{'A'}
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190547@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69018&edit=1 ID: 69018 Updated by: ajf@php.net Reported by: ajf at ajf dot me Summary: Constants supported for A::A but not A::{'A'} -Status: Open +Status: Not a bug Type: Bug Package: Scripting Engine problem PHP Version: 5.6.5 Block user comment: N Private report: N New Comment: Closing as "not a bug" since A::{'B'} was never supported, my bad. Previous Comments: ------------------------------------------------------------------------ [2015-02-09 16:43:04] ajf at ajf dot me ...actually, I'm not sure A::{'A'} was ever valid syntax. I make mistakes, ignore me. ------------------------------------------------------------------------ [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

« previous php.bugs (#190547) next »