Re: ctype second opinions

From: Date: Sun, 21 Jul 2002 06:26:32 +0000
Subject: Re: ctype second opinions
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7811@lists.php.net to get a copy of this message
On Fri, 19 Jul 2002, Pierre-Alain Joye wrote: > On Fri, 19 Jul 2002 08:41:53 -0500 (CDT) > Brent Cook <busterb@mail.utexas.edu> wrote: > > > Dear all, > > > > I would like your opinion, please. I'm currently arguing a bug in the > > PHP database, http://bugs.php.net/bug.php?id=18428, and > > basically feel > > that I have made the correct choice, while the PHP developer feels > > otherwise. > > > > The ctype functions in PHP currently return TRUE on an empty string. For > > instance, ctype_alpha('a') == TRUE, ctype_alpha('1') == FALSE, > > ctype_alpha('') == TRUE. I argued that since no characters in an empty > > string match the criteria, an empty string should return FALSE. The > > developer argued that "in an empty string every of the 0 charactetrs > > matches the (criteria)", so it should return TRUE. > > afaik, ctype_alpha checks only the type, returning true if the param is > an alhatype. An empty string is an alpha. That s a fact. You're pulling Brent's leg now right? Right? - Stig

« previous php.pear.dev (#7811) next »