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

2007-06-17 Thread Robin Vickery
On 13/06/07, Richard Davey [EMAIL PROTECTED] wrote: Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction ) { $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } if( $allow_thousand ) {

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

2007-06-17 Thread Nathan Nobbe
admittedly i had to read up quickly on the usage of a *binary pattern*where each bit in said *pattern* is used to represent the state of some boolean variable. wikipedia sufficed http://en.wikipedia.org/wiki/Bitwise_operation#OR this makes much more sense to me now; as ive seen this technique

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

2007-06-13 Thread Robert Cummings
On Wed, 2007-06-13 at 15:19 +0100, Richard Davey wrote: Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction ) { $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } if(

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

2007-06-13 Thread Ford, Mike
From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Wed 13/06/2007 15:19 To: PHP List Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: It's terribly verbose and inefficient... ?php $filter['flags'] = 0; if( $allow_fraction )