Re: #29525 [Opn->Csd]: substr_compare documentation paramer sensitivity should be insensitivity?

From: Date: Thu, 05 Aug 2004 11:37:28 +0000
Subject: Re: #29525 [Opn->Csd]: substr_compare documentation paramer sensitivity should be insensitivity?
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969362700@lists.php.net to get a copy of this message
Ford, Mike [LSS] wrote:
Actually, I'd regard this as a bug in the function, not the documentation. It makes much more sense as a "case_sensitivity" parameter -- if it's "case_insensitivity", you have to negate a negative to request a positive, which is very obscure and liable to silly errors. If the default value for this parameter were TRUE, it would still be "optionally case-insensitive" by specifying FALSE.
Most of the original PHP functions were case-sensitive. The -i- variants (stripos, stristr, eregi, etc.) came as an afterthought, so this function somewhat follows that rationale. Reversing the parameter now would break backwards compatibility (this function made it into both PHP 4.3.7+ and PHP 5.0.0), however, I've forwarded this onto the creator of the function, Ilia, for his input.
Cheers! Mike
Dave

« previous php.doc (#969362700) next »