On Tue, 2004-01-20 at 23:00, Luke wrote: > ok, i read the section, but even so > > if $a == $b > and $a == $c > then $b should be equal to $c
No this is not true, since types conversions can be different between a and b, a and c or between b and c. If you want the above logic to be true then you must use === for equality based on type also. > but php is saying otherwise? PHPis following the rules of type conversion which are not necessarily commutative (hope that's the right term). > this sounds confusing i want to try n get my head round it > > a string equals a integer of zero, A non-numeric string equals 0 by the rules of string to integer type conversion (that's not entirely true since I think the first numerical portion is the part converted as per atoi()). > and a string equals true, but the reason A non empty string equals true according to the rules of string to boolean type conversion, unless (I think) the string is '0'. > the bool doesnt equal the int is because when the string and int are > compared, the string is zero (because it has no numerical value)? You are talking about bool, string and int with respect to a bool-int equality check. This is confusing, only two values can be compared. From what hat did you pull the string? > did that make sense? am i right? You didn't make sense :) Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php