Re: cvs: phpdoc /scripts file-entities.php.in
| From: | Richard Quadling | Date: | Thu, 08 Jan 2009 17:07:31 +0000 |
| Subject: | Re: cvs: phpdoc /scripts file-entities.php.in | ||
| References: | 1 2 3 4 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-2991@lists.php.net to get a copy of this message | ||
2009/1/8 Hannes Magnusson <hannes.magnusson@gmail.com>:
> On Thu, Jan 8, 2009 at 16:09, Richard Quadling <rquadling@googlemail.com> wrote:
>> 2009/1/8 Hannes Magnusson <hannes.magnusson@gmail.com>:
>>> On Thu, Jan 8, 2009 at 12:54, Richard Quadling <rquadling@php.net> wrote:
>>>> rquadling Thu Jan 8 11:54:08 2009 UTC
>>>>
>>>> Modified files:
>>>> /phpdoc/scripts file-entities.php.in
>>>> Log:
>>>> ereg => strcascmp
>>>>
>>>>
>>>> http://cvs.php.net/viewvc.cgi/phpdoc/scripts/file-entities.php.in?r1=1.60&r2=1.61&diff_format=u
>>>> Index: phpdoc/scripts/file-entities.php.in
>>>> diff -u phpdoc/scripts/file-entities.php.in:1.60
>>>> phpdoc/scripts/file-entities.php.in:1.61
>>>> --- phpdoc/scripts/file-entities.php.in:1.60 Wed Jan 7 21:22:13 2009
>>>> +++ phpdoc/scripts/file-entities.php.in Thu Jan 8 11:54:08 2009
>>>> @@ -1,4 +1,4 @@
>>>> -<?php // vim: ts=4 sw=4 et tw=78 fdm=marker
>>>> +<?php // vim: ts=4 sw=4 et tw=78 fdm=marker
>>>> /*
>>>> +----------------------------------------------------------------------+
>>>> | PHP Version 4 |
>>>> @@ -17,7 +17,7 @@
>>>> | Gabor Hojtsy <goba@php.net> |
>>>> +----------------------------------------------------------------------+
>>>>
>>>> - $Id: file-entities.php.in,v 1.60 2009/01/07 21:22:13 bjori Exp $
>>>> + $Id: file-entities.php.in,v 1.61 2009/01/08 11:54:08 rquadling Exp $
>>>> */
>>>>
>>>> /**
>>>> @@ -46,10 +46,10 @@
>>>>
>>>> // ......:ARGUMENT PARSING:.....................................................
>>>>
>>>> -$not_windows = !eregi('WIN',PHP_OS);
>>>> +$not_windows = !!strcasecmp('WIN',PHP_OS);
>>>
>>> This does not make any sense at all.
>>>
>>> -Hannes
>>>
>>
>> <?php
>> echo 'Wanted', PHP_EOL;
>> var_dump(!eregi('WIN','bob'));
>> var_dump(!eregi('WIN','wIn'));
>> var_dump(!eregi('WIN','WIN'));
>>
>> echo PHP_EOL, 'strcasecmp', PHP_EOL;
>> var_dump(strcasecmp('WIN','bob'));
>> var_dump(strcasecmp('WIN','wIn'));
>> var_dump(strcasecmp('WIN','WIN'));
>>
>> echo PHP_EOL, '!strcasecmp', PHP_EOL;
>> var_dump(!strcasecmp('WIN','bob'));
>> var_dump(!strcasecmp('WIN','wIn'));
>> var_dump(!strcasecmp('WIN','WIN'));
>>
>> echo PHP_EOL, '!!strcasecmp', PHP_EOL;
>> var_dump(!!strcasecmp('WIN','bob'));
>> var_dump(!!strcasecmp('WIN','wIn'));
>> var_dump(!!strcasecmp('WIN','WIN'));
>> ?>
>>
>> Outputs:
>
> I don't care if it returns almost correct results (try "windows"),
> that is not a good readable line.
>
> -Hannes
>
0 < strcasecmp() does it.
Fixing ...
--
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"