Re: strcmp()?

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

 



On Monday 23 May 2011 15:00:27 tedd wrote:
> >Are you absolutely certain about that?
> >
> >    echo strcmp('These are nearly equal', 'These are almost equal'), "\n";
> >    echo strcmp('different', 'unequal'), "\n";
> >    echo strcmp('b', 'a'), "<br />\n";

My result is:
13 -17 1

I'm runninng PHP 5.2.14 on the ARM Linux with uClibc.
Certainly the result depends on architecture and/or libc, because PHP just 
calls system strcmp, nothing more.
So. to write compatible scripts one should check "< 0", not "== -1".

-- 
With Best Regards,
Vitalii Demianets
Head engineer
Factor-SPE
Kiev, Ukraine
tel/fax: +380(44)249-21-63

-- 
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