|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66822 Cannot use T_POW in const expression...
Submitted: 2014-03-05 05:16 UTC Modified: 2014-03-07 07:09 UTC
From: david at orlandophp dot org Assigned: datibbaw (profile)
Status: Closed Package: *General Issues
PHP Version: 5.6.0alpha2 OS: Mac OS X 10.9.2
Private report: No CVE-ID: None
 [2014-03-05 05:16 UTC] david at orlandophp dot org

Defining a constant with the `const` keyword and an expression that contains the `T_POW` (**) operator, the constant should be set to the value of the expression.


Using the `T_POW` operator in a `const` statement produces a Parse Error with message: "Parse error: syntax error, unexpected '**' (T_POW)"

Test script:

const MOLE = 2 ** 27;

echo MOLE;

Expected result:

Actual result:
Parse error: syntax error, unexpected '**' (T_POW) in example.php on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-05 21:46 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: datibbaw
 [2014-03-07 07:09 UTC]
-Status: Assigned +Status: Closed
 [2014-03-07 07:09 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 02:01:28 2024 UTC