Re: strcmp()?

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

 



On 23 May 2011 13:24, Joshua Kehn <josh.kehn@xxxxxxxxx> wrote:
> On May 23, 2011, at 8:17 AM, tedd wrote:
>
>>> > Mike:
>>>>
>>>> That's interesting. Try the same comparisons here:
>>>>
>>>> http://www.webbytedd.com/lcc/citw229/string-compare.php
>>>>
>>> > For me they are 1, -1, and 1.
>>>
>>> Might that have something to do with the version of PHP running?
>>>
>>>
>>> -Josh
>>
>>
>> -Josh:
>>
>> I've written this on two different servers.
>>
>> One is Version 5.2.15 and the other is version 5.2.5 and they both report the same results.
>>
>> Cheers,
>>
>> tedd
>
>
> I just checked under 5.3.2 and it gives the same -1, 0, 1 results.
>
> Regards,
>
> -Josh
> ____________________________________
> Joshua Kehn | Josh.kehn@xxxxxxxxx
> http://joshuakehn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Just tested the code below on Windows, using official releases (and
some RCs also).

<?php
echo
	PHP_VERSION, ' ',
	strcmp('These are nearly equal', 'These are almost equal'), ' ',
	strcmp('different', 'unequal'), ' ',
	strcmp('b', 'a');
?>

And for all of the V4 and V5 releases I've got, the result is the same...

-1 1 -1


-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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