NYCPHP Meetup

NYPHP.org

[nycphp-talk] ctype_digit in PHP 5.1.x

Chris Shiflett shiflett at php.net
Fri Dec 2 11:21:59 EST 2005


Scott Mattocks wrote:
> Anyway, the problem is with ctype_digit returning true for null
> strings.

There is no such thing as a null string, because null is not a string. I 
think you mean the empty string, based on your example:

> var_dump(ctype_digit(''));
> 
> There is a comment on the manual page that says it shouldn't
> return true for versions since 4.4.1, but that is just a comment.
> I can't find any bug reports for it and I don't want to create
> one unless the issue still exists in the latest version.

Why would this be considered a bug?

The ctype_digit() function returns true if every character in a string 
is a digit. The length of the string seems like a separate criterion.

Chris

-- 
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/



More information about the talk mailing list