"Saurabh Kapoor" <[EMAIL PROTECTED]> wrote in message
> I am a C programmer, looking to migrate some code to PHP (Unusual, but my
> colleagues request it).
> Can someone tell me the size (in bytes) of the type int in PHP.
> I need a 16 bit (2 byte) storage unit (I use a lot of bitwise operations)

Try this:


 $val = 2; $last = 1; $pow = 1;

 echo "<pre>\n(0) 1\n(1) 2";
 while ($val > $last) {
  $last = $val;
  $val = $val << 1;

  echo "\n($pow) $val";
 echo "</pre>";

Running PHP 4.0.6 on WinMe, I get 32 bits.

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]

Reply via email to