Re: Re: why not use strtol instead of php_filter_parse_{int,hex,octal}?

From: Date: Mon, 22 Feb 2010 14:02:36 +0000
Subject: Re: Re: why not use strtol instead of php_filter_parse_{int,hex,octal}?
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-47023@lists.php.net to get a copy of this message
On Mon, 22 Feb 2010, Pierre Joye wrote: > On Mon, Feb 22, 2010 at 2:21 AM, Raphael Geissert <geissert@php.net> wrote: > > Raphael Geissert wrote: > >> > >> If there's no objection, I would like to remove them entirely and use > >> strtol in php_filter_int. > > > > By the way, I don't think that the fact that strtol is locale-aware should > > be a reason to make the change. Since scripts are expected to use the value > > returned by filter_var() there should be no problem with the fact that > > strings such as "100'000" are accepted as a valid integer, under certain > > locales. > > Please don't commit this change. I remember some issues with strtol > (portability, BC breaks, etc.). Please wait until we figured them out, > or find back in the archives why strtol could be a bad idea. Poratability was indeed the reason, as well as the locale issues that you mention (POSIX locales==useless). Please don't commit this. regards, Derick -- http://derickrethans.nl | http://xdebug.org twitter: @derickr

« previous php.internals (#47023) next »