"Saurabh Kapoor" <[EMAIL PROTECTED]> wrote in message
001901c12d63$b1b62100$9e2823d9@killer666">news:001901c12d63$b1b62100$9e2823d9@killer666...
> 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:
<?php
$val = 2; $last = 1; $pow = 1;
echo "<pre>\n(0) 1\n(1) 2";
while ($val > $last) {
$last = $val;
$val = $val << 1;
$pow++;
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]