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

From: Date: Thu, 14 Jun 2007 00:49:46 +0000
Subject: Re: Re[2]: [PHP] Need a more elegant way of bitwise ORing values
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-256960@lists.php.net to get a copy of this message
On Thu, 2007-06-14 at 00:33 +0100, Richard Davey wrote: > 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 += -=) http://ca3.php.net/manual/en/language.operators.php There's quite a few. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#256960) next »