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 this makes much more sense to me now; as ive seen this technique b

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... > $filter['flags'] = 0; > if( $allow_fraction ) > { > $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; > } > if( $allow_thousand )

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

2007-06-16 Thread tedd
At 3:19 PM +0100 6/13/07, Richard Davey wrote: $filter['flags'] = 0; > if( $allow_fraction ) { > $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; } > if( $allow_thousand ) { > $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND; } > if( $allow_scientific ) { >

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... > > > > > $filter['flags'] = 0; > > > if( $allow_

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... > > > > > $filter['flags'] = 0; > > > if( $allow_fraction ) > > { > > $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; >

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

2007-06-13 Thread Richard Davey
Hi Robert, Wednesday, June 13, 2007, 3:15:39 PM, you wrote: > It's terribly verbose and inefficient... > $filter['flags'] = 0; > if( $allow_fraction ) > { > $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION; > } > if( $allow_thousand ) > { > $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND