Re: [RFC] Permit trailing whitespace in numeric strings
| From: | Derick Rethans | Date: | Tue, 09 Apr 2019 11:10:56 +0000 |
| Subject: | Re: [RFC] Permit trailing whitespace in numeric strings | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105171@lists.php.net to get a copy of this message | ||
On Tue, 9 Apr 2019, Nikita Popov wrote:
> On Tue, Apr 9, 2019 at 12:57 PM Derick Rethans <derick@php.net> wrote:
>
> > > think about the desired behavior of (int)?
> >
> > I think there should be no difference in behaviour between implicit and
> > explicit cases.
>
> So to rephrase my question: While I think there is a consensus that
> "123xyz" and " 123" should not be accepted by an "int"
> parameter, it
> is not clear to me that there is also a consensus that (int) "123xyz"
> and (int) " 123" should result in 0 rather than 123.
I meant that (int) should accept the same data as "int" parameters, and
hence, the result of (int) " 123" should be 0.
cheers,
Derick
--
https://derickrethans.nl | https://xdebug.org | https://dram.io
Like Xdebug? Consider a donation: https://xdebug.org/donate.php,
or become my Patron: https://www.patreon.com/derickr
twitter: @derickr and @xdebug