Re[2]: [PHP] Need a more elegant way of bitwise ORing values

From: Date: Wed, 13 Jun 2007 23:33:25 +0000
Subject: Re[2]: [PHP] Need a more elegant way of bitwise ORing values
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-256959@lists.php.net to get a copy of this message
Hi Richard, Wednesday, June 13, 2007, 6:44:55 PM, you wrote: >> if ($allow_fraction) > //Should we warn you that $allow_fraction is not actually defined?... Should I warn you that to save everyone's sanity I only posted what was needed from the code? ;) $allow_fraction came from a function parameter. I'd type hint it to boolean if PHP allowed, but alas ... > $flags |= FILTER_FLAG_ALLOW_FRACTION; Yup, Robert showed this already in this thread. Nice short-cut, wasn't aware it worked with that operator. That's definitely my "learnt something new" for today. I wonder what else it works for? (besides the obvious += -=) Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk "Never trust a computer you can't throw out of a window"

« previous php.general (#256959) next »