Bug #66822 [Opn->Asn]: Cannot use T_POW in const expression...

From: Date: Wed, 05 Mar 2014 21:46:37 +0000
Subject: Bug #66822 [Opn->Asn]: Cannot use T_POW in const expression...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184545@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66822&edit=1 ID: 66822 Updated by: nikic@php.net Reported by: david at orlandophp dot org Summary: Cannot use T_POW in const expression... -Status: Open +Status: Assigned Type: Bug Package: *General Issues Operating System: Mac OS X 10.9.2 PHP Version: 5.6.0alpha2 -Assigned To: +Assigned To: datibbaw Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2014-03-05 05:16:32] david at orlandophp dot org Description: ------------ Expected: 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. Actual: Using the T_POW operator in a const statement produces a Parse Error with message: "Parse error: syntax error, unexpected '**' (T_POW)" Test script: --------------- <?php const MOLE = 2 ** 27; echo MOLE; Expected result: ---------------- 134217728 Actual result: -------------- Parse error: syntax error, unexpected '**' (T_POW) in example.php on line 2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66822&edit=1

« previous php.bugs (#184545) next »