Re: When is "z" != "z" ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is just one of those cases where the designers had to make a judgement call on how things were going to operate.  It makes sense if you look at the two things separately (incrementing vs string 'greatness' evaluation) and makes sense that how they chose to implement the functions are two valid choices among many ways that it could have been handled.

>From a developers point of view it becomes "it is what it is".  Now understanding the nature of the beast we must accept that this is just how PHP works.  It's not wrong, it's just strange when it comes to z++ combined with a for loop.  Probably an unforeseen disconnect when designing PHP but the most important thing is understanding HOW it works (more so than 'why' it was designed that way) and coding accordingly.

There are many other ways to accomplish an A-Z sequence so as long as what's been discussed is understood as "just how PHP is", and that it's logical for certain purposes, then we can choose one of the other choices for solving the problem.


-TG

= = = Original message = = =

-TG:

Thanks for your explanation and time.

Normally, I don't alpha++ anything -- not to criticize others, but to me it doesn't make much sense to add a number to a character.  But considering the php language is so string aware, as compared to other languages, I just tried it on a lark just to see what would happen.

Okay, so I found out it's limitations and quirks.

But, you must admit that it is confusing to have a loop that goes from "a" to "z" and considers "aa" but not "aaa".

Now, if the loop just went from a to z, then I would think that would be logical. But I fail to see the logic behind considering "aa" but not "aaa" in the evaluation. But then again, I'm not that informed.

Enough said.

tedd



___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux