Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Joel
You might want to take a look at the BC Math functions, which can perform operations on arbitrary length numbers. On Tue, Mar 15, 2011 at 12:31 PM, Ford, Mike wrote: >> -Original Message- >> From: Andy McKenzie [mailto:amckenz...@gmail.com] >> Sent: 15 March 2011 15:51 >> >> As it turns o

RE: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Ford, Mike
> -Original Message- > From: Andy McKenzie [mailto:amckenz...@gmail.com] > Sent: 15 March 2011 15:51 > > As it turns out, the most important lesson here is: "Don't trust > what > anyone tells you." The old server is 64-bit. The new server is > 32-bit. Once I stopped to check that mysel

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Daniel Brown
On Tue, Mar 15, 2011 at 12:26, Adam Richardson wrote: > > Hah! > > This was the list with the Alex. Too many lists, too few neurons. In the Facebook age, email really needs some sort of "I Agree" button. I'm right-on with you on that one, Adam. -- Network Infrastructure Manager http://www

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Adam Richardson
On Tue, Mar 15, 2011 at 12:21 PM, Daniel Brown wrote: > On Tue, Mar 15, 2011 at 12:18, Adam Richardson > wrote: > > > > My apologies: > > > > Nice detective work ANDY (sorry, Andy, see earlier note about my shabby > > memory.) I'd just replied to an Alex on another list. > > > > Sorry. > > D

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Daniel Brown
On Tue, Mar 15, 2011 at 12:18, Adam Richardson wrote: > > My apologies: > > Nice detective work ANDY (sorry, Andy, see earlier note about my shabby > memory.) I'd just replied to an Alex on another list. > > Sorry. Don't be. He signs his emails as "Alex." I had to do a double-take before, t

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Adam Richardson
On Tue, Mar 15, 2011 at 12:15 PM, Adam Richardson wrote: > On Tue, Mar 15, 2011 at 11:50 AM, Andy McKenzie wrote: > >> > Now: I did a little more looking around this morning, and it looks >> > like I may well run into problems here given that I'm moving from a >> > 32-bit architecture to a 64-bit

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Adam Richardson
On Tue, Mar 15, 2011 at 11:50 AM, Andy McKenzie wrote: > > Now: I did a little more looking around this morning, and it looks > > like I may well run into problems here given that I'm moving from a > > 32-bit architecture to a 64-bit architecture. Bitwise math is still > > fairly obscure to me,

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Andy McKenzie
> Now:  I did a little more looking around this morning, and it looks > like I may well run into problems here given that I'm moving from a > 32-bit architecture to a 64-bit architecture.  Bitwise math is still > fairly obscure to me, so it's likely that I'm overlooking something > obvious, but may

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Andy McKenzie
On Tue, Mar 15, 2011 at 8:07 AM, Andy McKenzie wrote: > On Mon, Mar 14, 2011 at 11:39 PM, Adam Richardson > wrote: >>> >>> This one's got me stumped.  I >>> have the following line in a script: >>> >>> $this->bc = ($this->network | (~$this->netmask)) & 4294967295; >>> >>> $this->network and $thi

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-15 Thread Andy McKenzie
On Mon, Mar 14, 2011 at 11:39 PM, Adam Richardson wrote: >> >> This one's got me stumped.  I >> have the following line in a script: >> >> $this->bc = ($this->network | (~$this->netmask)) & 4294967295; >> >> $this->network and $this->netmask should both be of type long, and I >> should wind up wit

Re: [PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-14 Thread Adam Richardson
> > This one's got me stumped. I > have the following line in a script: > > $this->bc = ($this->network | (~$this->netmask)) & 4294967295; > > $this->network and $this->netmask should both be of type long, and I > should wind up with another long. I didn't write the original method, > and I can't

[PHP] Failure in bitwise operations moving from 5.2.x to 5.3.x

2011-03-14 Thread Andy McKenzie
Greetings, I'm moving some scripts from an older server (SuSE who-knows-what, running PHP 5.2.5) to a newer one (Ubuntu 10.10, running PHP 5.3.2). For the most part there haven't been any problems, or they've been things that I was able to fix easily. This one's got me stumped. I have the fol