Hi! > Stan, you are right to correct me. Sorry. However, I still feel that > the implicit assumption is that sizeof(long) == 2*sizeof(int) and this
I'm not sure where this assumption exists. Could you be more specific? PHP uses long for most integer values, and int for some internal things and sometimes those intersect, but usually there is either conversion or we can be pretty sure the value, while being nominally long, is in range of int (such as when it is an option with fixed set of values, etc.). However, there were certainly bugs in the past in this area, and may be still some, so eliminating them of course would be good. But right know I don't know of any code that makes this specific assumption. > isn't the case with visualC, and PHP internal data structures compiled > with visualC and gcc are significantly different; for example hash keys > are 32 bits long on Windows and 64bits on *nix. Why aren't they 32bits, Yes, they are different, because long size is different, and PHP uses long (more specific, ulong) to store hash values. This is because numeric values are long, and it's easier to use the same type for both than bother with converting back and forth. As you noted, the difference for hashing is minimal since the value is anyway brought to hash size, and hashes of size more than 32-bit LONG_MAX aren't very practical. However, it matters in other parts of the code. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php