php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67776 Constant Expressions Syntax
Submitted: 2014-08-05 16:59 UTC Modified: 2016-11-11 21:52 UTC
From: joelm@php.net Assigned: nikic (profile)
Status: Closed Package: PHP Language Specification
PHP Version: master OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
2 + 16 = ?
Subscribe to this entry?

 
 [2014-08-05 16:59 UTC] joelm@php.net
Description:
------------
https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#constant-expressions

The syntax rules for this look wrong. It appears that constant-expression can produce any expression which is too broad; constant-expression is only suppose to be able to produce restricted expressions that can be used for default value initializer or a property initializer. 

(However, it is believed by some that the Constraints sufficiently limit the syntax to what is being suggested. So this may not be an issue.)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-06-28 21:40 UTC] stas@php.net
-PHP Version: Irrelevant +PHP Version: master
 [2016-11-11 21:52 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2016-11-11 21:52 UTC] nikic@php.net
The constraints now specify which syntactic elements are allowed inside constant expressions.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC