Re: [PHP4BETA] cvs: php4 /ext/standard/ string.c
| From: | Hartmut Holzgraefe | Date: | Thu, 01 Jun 2000 14:33:14 +0000 |
| Subject: | Re: [PHP4BETA] cvs: php4 /ext/standard/ string.c | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-16036@lists.php.net to get a copy of this message | ||
Andrei Zmievski wrote:
> > - *++r=toupper((unsigned char)*r);
> > + *r=toupper((unsigned char)*++r);
>
> Are you sure about this? It seems that you're replacing space
> character with the uppercased next one.
the two assignments are equivalent, as the ++ operator has
a higher precedence then assingments or pointer de-referencing
see script below for proof of operation
> -Andrei
> * Use the source, Luke. *
so that's where i get all theese obi-wan errors from ?
<?
$tests = array( "a" => "A",
" a" => " A",
"a " => "A ",
" a " => " A ",
"a a a" => "A A A",
"\ta\na\ra a" >= "\tA\nA\rA\A",
"a a a a a" => "A A A A A"
);
reset($tests);
while(list($key,$val)=each($tests)) {
if(!is_string($key)&&!is_string($val)) {
continue;
}
if(ucwords($key)!==$val) {
print "ucwords($key) is ".ucwords($key)."instead of $val\n";
} else {
print "ucwords($key) ok\n";
}
}
?>