-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow arrays with define(), to match const syntax support #951
Conversation
OK, Bob Weinand pointed out I need to ensure the array contains no references or non-scalars. Will do that. EDIT: Done, see commit below. |
@@ -68,6 +68,8 @@ PHP 5.6 UPGRADE NOTES | |||
- Added constant scalar expressions syntax. | |||
(https://wiki.php.net/rfc/const_scalar_exprs) | |||
|
|||
- Constants can be arrays. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be a better description here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Arrays are now permitted as constant values."?
1bf3901
to
04fcd81
Compare
Made a version for master as well: #954 |
Hey @dstogov, didn't you say you'd take a look at this? |
Hi Andrea, Sorry, I thought you were gong to provide a patch for master. I made a patch for master on top of yours - Thanks. Dmitry. On Sat, Dec 20, 2014 at 6:42 AM, Andrea Faulds notifications@github.com
|
Yours seems alright, though, I'll merge it. |
Merged here, closing this request: 0833fd4 |
This fixes an oversight in PHP 5.6, where you can create constant arrays with
const
yet not withdefine()
. The hope is it can go into a micro release, as it's basically just a bugfix.