ok, i read the section, but even so if $a == $b and $a == $c then $b should be equal to $c
but php is saying otherwise? this sounds confusing i want to try n get my head round it a string equals a integer of zero, and a string equals true, but the reason 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)? did that make sense? am i right? -- Luke "Robert Cummings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 2004-01-20 at 22:39, Luke wrote: > > yeah its strange, > > > > $test is equal to $test2, > > $test is equal to $test3 > > but $test2 is not equal to $test3, > > > > $test = "string"; > > $test2 = true; > > $test3 = 0; > > if($test == $test2){ > > echo "hi"; > > } > > > > Looks fine to me... > > $test == $test2: $test is not an empty string and thus evaluates to > true. > > $test == $test3: $test is converted to an integer to compare against > $test3. Conversion of $test to integer results in 0, > which happens to be equal to $test3 > > You should read the section on type juggling. > > http://ca2.php.net/language.types.type-juggling > > 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