It seems to me that the issue is that $i++ is nonsensical if $i is a string (and $i is a string, not a character). But instead of raising an error, PHP soldiers on and tries to apply some completely unexpected function.
That are less than or equal to z?