In ($number == 1) number is assigned 1 and the comparison is made.Ex: 1==1 here output is Boolean.
But in {$number == 1 && $name == "hello"} $number is not assigned because of flower bracket $number is compared with 1 so output obtained is not Boolean.