Re: Adding "numeric" type hint
| From: | Christoph Becker | Date: | Wed, 29 Apr 2015 21:27:33 +0000 |
| Subject: | Re: Adding "numeric" type hint | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86031@lists.php.net to get a copy of this message | ||
Yasuo Ohgaki wrote:
> On Wed, Apr 29, 2015 at 9:33 AM, Ryan Pallas <derokorian@gmail.com> wrote:
>
>> I agree with Stanislav here, if you want to accept any type of number, its
>> easy enough to add your own checking to do that with the wonderful
>> is_numeric. And for simplicity, make an invalidArgument method that you can
>> call after manually checking if arguments are wrong:
>> *http://3v4l.org/r0qO0
>> <http://3v4l.org/r0qO0>* Works for all versions this
>> tool runs as well.
>
> The issue is that weak mode type hint is *not* weak at all. It forces to
> have
> machine native type rather than it's data form.
A solution for this issue has been proposed by the "Big Integer Support"
RFC which has been withdrawn. It's too late for PHP 7.0 to re-open it,
but it might be reasonable to to so for PHP 7.1.
--
Christoph M. Becker