Re[8]: [PHP] Need a more elegant way of bitwise ORing values
| From: | Richard Davey | Date: | Wed, 13 Jun 2007 14:59:06 +0000 |
| Subject: | Re[8]: [PHP] Need a more elegant way of bitwise ORing values | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-256868@lists.php.net to get a copy of this message | ||
Hi Robert,
Wednesday, June 13, 2007, 3:37:38 PM, you wrote:
> Personally I hate constants (can't use non-scalar values so why get used
> ot them... also they're just another point for name collision) so if it
> were my own code I'd do something more like the following:
Sure, but the filter extension uses them, which is where they come
from. They aren't of my own creation, and I cannot assume that the
values assigned to them won't change in the future, so can't hardcode
my way around them.
I don't have anything against side-wide constants myself (no worse
than an array shoved into $GLOBALS) but PHP seems to be moving more
and more towards the use of constants within extensions as function
parameters, PDO being another popular culprit that springs to mind.
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"