[UPHPU] Understanding php's logic

Jacob Fugal jacob at fugal.net
Tue Apr 6 16:47:05 MDT 2004


Mac Newbold wrote:

> Yes, the above all makes sense.
> 
> 
>>2) "Z"++ == "AA"
> 
> 
> However, this one does not. How does PHP figure that "Z"++ ="AA" ?
> 
> I could understand if "Z" (char 90) + 1 == "[" (char 91), but, or even if
> "Z" + 1 == "Z1" (maybe not applicable to ++, though). But it not only
> wraps around, but adds another letter to the string... how does that work?
> And where is it documented?
> 
> Confused,
> Mac

I agree it seems a rather strange interpretation of ++ on strings, and I 
don't know where it's documented. I may not even be right, this just 
seems the most logical interpretation of the evidence he presented. And 
in a weird sort of way, it does make sense -- though not as much sense 
as "Z"++ = "[".

Jacob




More information about the UPHPU mailing list