For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > September 2005 > #34634 [Opn]: "const FOO = 1<<0" bits not allowed









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #34634 [Opn]: "const FOO = 1<<0" bits not allowed
derick@php.net

2005-09-25, 6:57 pm

ID: 34634
Updated by: derick@php.net
Reported By: djmaze at cpgnuke dot com
Status: Open
-Bug Type: Feature/Change Request
+Bug Type: Documentation problem
Operating System: Linux
PHP Version: 5.0.5
New Comment:

This is a documentation problem.


Previous Comments:
------------------------------------------------------------------------

[2005-09-25 15:18:43] djmaze at cpgnuke dot com

Description:
------------
The manual at following address doesn't explain what kind of constants
you may define.
http://www.php.net/manual/en/langua...5.constants.php
I've tried to use bits but PHP 5 generates a parse errors on those as
well.
Either add in the documentation which are allowed or extend the use of
const.

Reproduce code:
---------------
<?php
class bar
{
const ASSOC = 1<<0; # CRASH
const SQL_ASSOC = MYSQL_ASSOC; # Works
}
?>

Expected result:
----------------
A constant bit

Actual result:
--------------
Parse error: syntax error, unexpected T_SL, expecting ',' or ';'


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=34634&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com