|  | Posted by Rami Elomaa on 05/31/07 13:56 
Schraalhans Keukenmeester kirjoitti:
 > Which makes me wonder why there's such a
 > loose definition of the retval, and what is actually stored in it inside
 > the func.
 
 Perhaps in a future version of php they want to make it return some sort
 of number to indicate how much they are different. Or maybe they find
 out that returning -99999 is faster than -1... Perhaps in the future
 strcmp('abc','abd') might return 1, because only one letter is
 different, but strcmp('abc','xyz') would return something completely
 different. If they keep the definition loose, they can improve the code
 in the future, without breaking backwards compatibility. This means that
 a script that now tests if(strcmp($foo,$bar)<0) works now for -1, but it
 will also work for -42. It's all about reserving the possibility for
 future improvements.
 
 --
 Rami.Elomaa@gmail.com
 
 "Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
 usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze
 [Back to original message] |