Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0

From: Date: Fri, 08 Feb 2013 22:12:08 +0000
Subject: Re: AW: [PHP-DEV] FILTER_VALIDATE_INT and +0/-0
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-65736@lists.php.net to get a copy of this message
On Fri, 8 Feb 2013, hakre wrote:

> Von: Gustavo Lopes <glopes@nebm.ist.utl.pt>
> 
> > So the question is only whether "+0" or "-0" (or 
> > "+0", etc.) should be accepted as integers by FILTER_VALIDATE_INT. I 
> > think they should, because we also accept non-canonical inputs such as 
> > "+5", i.e., we always accept a sign. It's true that 0 is neither 
> > positive or negative, but I don't think "accepts a leading sign, except 
> > if it's 0" is a good option. It's an unnecessary special case.
> 
> A special case still left is "±0". It is with the 'PLUS-MINUS SIGN'
> (U+00B1).

PHP can't parse that as a number, so forget about adding this.

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
Posted with an email client that doesn't mangle email: alpine


Thread (14 messages)

« previous php.internals (#65736) next »