3 ms·
> are there languages where you can't declare a constant with a multiplication expression? obviously PHP. php > const X = 1; php > echo X; 1 php > con
by zemo 12y ago
> are there languages where you can't declare a constant with a multiplication expression?
obviously PHP.
php > const X = 1;
php > echo X;
1
php > const Y = 1 * 2;
Parse error: parse error, expecting `','' or `';'' in php shell code on line 1
php > echo Y;
Y
- mappu 12y agoFixed in the (upcoming) PHP 5.6. https://wiki.php.net/rfc/const_scalar_exprs https://wiki.php.net/rfc/const_scalar_exprs