What is the difference between $x > $y and $x != $y | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is the difference between $x > $y and $x != $y

Both return true if $x is not equals to $y

21st Mar 2017, 5:09 PM
Wilson Bol
Wilson Bol - avatar
2 Answers
+ 5
Do you mean $x <> $y and $x != $y are the same?
21st Mar 2017, 5:23 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 3
$x > $y means that $x needs to be bigger than $y. $x != $y means that $x is not allowed to be the same as $y. Output 1: If x is bigger than y, return true, if it is not it returns false. Output 2: If x does NOT equal y, it return true, if it does, it returns false.
21st Mar 2017, 5:18 PM
Søren