Page 1 of 1

comparison operators

Posted: Wed Nov 17, 2004 1:35 pm
by rehfeld
is there a diff between these?

Code: Select all

<?php

$var1 != $var2

$var1 <> $var2


?>

Posted: Wed Nov 17, 2004 2:08 pm
by neophyte
According to this I'd say no.

Posted: Wed Nov 17, 2004 4:08 pm
by rehfeld
yeah thats what led me to ask the question.
i see people use <> occasionally and was just curious if there was some diff performance, or if it was just habit from other prog langs.

Posted: Wed Nov 17, 2004 4:50 pm
by John Cartwright
I don't think <> would work on a string, althought != does

Posted: Wed Nov 17, 2004 4:51 pm
by timvw
Well, not equal is in
(most) programming languages: !=
sql: <>


But MySQL also supports != and PHP also supports <>