[PHP] peculiar behaviour of large integers with and

2001-07-13 Thread scott [gts]

Has anyone come across this before?

// compare 5 to the max value of an integer
if (5  -2147483647) {
  print This is;
}

// knock a digit off the max and compare again
if (5  -214748364) {
  print weird;
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread Johnson, Kirk

?
// compare 5 to the max value of an integer
if (5  -2147483647) {
  print This is;
} else {
  print Nothing ;
}

// knock a digit off the max and compare again
if (5  -214748364) {
  print weird;
} else {
  print unusual;
}
?

I get nothing unusual

Kirk

 -Original Message-
 From: scott [gts] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 12:08 PM
 To: php
 Subject: [PHP] peculiar behaviour of large integers with  and 
 
 
 Has anyone come across this before?
 
 // compare 5 to the max value of an integer
 if (5  -2147483647) {
   print This is;
 }
 
 // knock a digit off the max and compare again
 if (5  -214748364) {
   print weird;
 }

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread scott [gts]

after reading thru the PHP site some more, i found a little
note mentioning a problem with the way negative integers are
handled in v4.0.6...

what version are you using?
what do you see when you run this code?

if (5  -2147483647) {
print This is printed.;
}

if (5  -214748364) {
print This is not.;
}

 -Original Message-
 From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 2:23 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] peculiar behaviour of large integers with  and 
 
 
 ?
 // compare 5 to the max value of an integer
 if (5  -2147483647) {
   print This is;
 } else {
   print Nothing ;
 }
 
 // knock a digit off the max and compare again
 if (5  -214748364) {
   print weird;
 } else {
   print unusual;
 }
 ?
 
 I get nothing unusual
 
 Kirk
 
  -Original Message-
  From: scott [gts] [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 13, 2001 12:08 PM
  To: php
  Subject: [PHP] peculiar behaviour of large integers with  and 
  
  
  Has anyone come across this before?
  
  // compare 5 to the max value of an integer
  if (5  -2147483647) {
print This is;
  }
  
  // knock a digit off the max and compare again
  if (5  -214748364) {
print weird;
  }
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread Johnson, Kirk

I am running 4.0.6. Nothing prints to the screen using a cut and paste of
the code below.

 -Original Message-
 From: scott [gts] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 12:25 PM
 To: php
 Subject: RE: [PHP] peculiar behaviour of large integers with 
  and 
 
 
 after reading thru the PHP site some more, i found a little
 note mentioning a problem with the way negative integers are
 handled in v4.0.6...
 
 what version are you using?
 what do you see when you run this code?
 
 if (5  -2147483647) {
 print This is printed.;
 }
 
 if (5  -214748364) {
 print This is not.;
 }

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] peculiar behaviour of large integers with and

2001-07-13 Thread Johnson, Kirk

I'll bet it did! Sorry, nothing unusual here, good luck.

 -Original Message-
 From: scott [gts] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 12:50 PM
 To: php
 Subject: RE: [PHP] peculiar behaviour of large integers with 
  and 
 
 
 i guess you've got a more recent version of PHP than i do...
 
 For me, it prints out This is printed but not 
 This is not printed, which made my eyebrows touch the
 ceiling when i first saw that... 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]