On Mon, Jul 02, 2001 at 05:01:43PM -0500, Brian Moon wrote:
> IMO, I like preg_match to return a bool and preg_match_all return a count.
> But that is me. It may be thought of as inconsistent to some. I just see
> the functions has having a different purpose.
That would make sense. preg_match_all() would return 1 if only
one match is found, so there's no need for preg_match() to return
the number of matches.
However, even if preg_match() were to return a one or zero, it
would still function the same in boolean evaluations. That makes
the whole thing simply a matter of "correctness". Returning an
'int' would be more consistent but returning a boolean would be
specific.
--
Jon Parise ([EMAIL PROTECTED]) . Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/ : Computer Science House Member
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]