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

From: Date: Mon, 09 Feb 2015 16:17:51 +0000
Subject: Bug #69018 [Opn]: Constants supported for A::A but not A::{'A'}
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190544@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
 User updated 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:

Er, the expected result was supposed to be this:

array(1) {
 [0]=> string(1) "a"
}

Sorry about that.


Previous Comments:
------------------------------------------------------------------------
[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)

« previous php.bugs (#190544) next »