anyways, like said, it's behaving correctly.
"test"<>$i converts $i to string.
"test" is different than "0" or "" or "1"

$i<>"test" forces conversion from string to integer. there is0 no numeral part in "test" so the comparison in your examples is:
$i<>0
_________________________
!

download KiXnet