Re: [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: [PHP] Need a more elegant way of bitwise ORing values

2007-06-13 Thread Richard Lynch
On Wed, June 13, 2007 8:13 am, Richard Davey wrote: > Hi all, > > Can anyone think of a more elegant way of achieving the following? > > $flags = array(); $flags = 0; > > if ($allow_fraction) //Should we warn you that $allow_fraction is not actually defined?... //You don't have register_globals

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

2007-06-13 Thread Zoltán Németh
2007. 06. 13, szerda keltezéssel 14.13-kor Richard Davey ezt írta: > Hi all, > > Can anyone think of a more elegant way of achieving the following? > > $flags = array(); > > if ($allow_fraction) > { > $flags[] = FILTER_FLAG_ALLOW_FRACTION; > } > > if ($allow_thousand) > { > $flags[] =