Re: cvs: php4 /ext/standard string.c
| From: | Sterling Hughes | Date: | Fri, 07 Sep 2001 09:41:08 +0000 |
| Subject: | Re: cvs: php4 /ext/standard string.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-7282@lists.php.net to get a copy of this message | ||
On Fri, 7 Sep 2001, Thies C. Arntzen wrote:
> On Thu, Sep 06, 2001 at 08:54:54AM -0000, Sterling Hughes wrote:
> > sterling Thu Sep 6 04:54:54 2001 EDT
> >
> > Modified files:
> > /php4/ext/standard string.c
> > Log:
> > avoid lowercasing the string
>
> could you give me an example why this is needed? i don't see
> any calls to SEPERATE_ZVAL in any other places.
>
Take the following:
<?php
$str = "FOOMOMMA";
$needle = "mom";
echo "String: $str\n";
echo "Needle: $needle\n";
$poo = stristr($needle, $str);
echo "\n****AFTER MATCH****\n";
echo "String: $str\n";
echo "Needle: $needle\n";
echo "Match: $poo\n";
?>
and take a look at the results before and after the patch...
Before, $str was being lowercased, after it is not modified.
I can see a case for perhaps moving it from SEPERATE_ZVAL() to a
simple estrndup() onto a new string, or modifying the underlying
algorithm to make it non-destructive, however, I broke this
functionality in an underlying API cleanup, so I just reverted this
portion to its previous state, I wasn't really concerned in changing
this...
-Sterling