Re: [RFC] Scalar Type Hinting With Casts (re-opening)
| From: | Andrea Faulds | Date: | Thu, 24 Jul 2014 23:48:28 +0000 |
| Subject: | Re: [RFC] Scalar Type Hinting With Casts (re-opening) | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-76082@lists.php.net to get a copy of this message | ||
On 23 Jul 2014, at 19:37, Andrea Faulds <ajf@ajf.me> wrote:
>
> On 23 Jul 2014, at 19:21, Robert Williams <rewilliams@thesba.com> wrote:
>
>> Also, do int, float, and numeric accept numbers in octal, hex, scientific notation, etc.? I
>> don’t believe there are any examples in the RFC that intentionally or accidentally show what
>> happens with, say, 0x2f as a value.
>
> Ooh, you’ve caught me out there. The patch as it stands would permit such non-decimal
> numbers, which isn’t what it should do as convert_to_long_base_safe should actually permit only
> the specified base.
>
> So, yes it does permit non-decimal numbers, but it’s a bug I need to fix.
Said bug has been fixed in the proposed patch now. “0xa” is no longer valid for int, float or
numeric. It never should’ve been valid, but the implementation of
convert_to_(long_base|double|numeric)_safe was incorrect.
--
Andrea Faulds
http://ajf.me/