Re: Re: GMP and empty()
| From: | Yasuo Ohgaki | Date: | Mon, 30 Dec 2013 10:36:26 +0000 |
| Subject: | Re: Re: GMP and empty() | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70918@lists.php.net to get a copy of this message | ||
Hi all,
On Mon, Dec 30, 2013 at 7:23 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> On Mon, Dec 30, 2013 at 7:02 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
>
>> Apparently, we need type check and/or float support in GMP.
>>
>
> We need error instead of type check.
> Possible patch is
>
> [yohgaki@dev php-src]$ git diff ext/gmp/
> diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
> index 8835f05..a64e486 100644
> --- a/ext/gmp/gmp.c
> +++ b/ext/gmp/gmp.c
> @@ -1036,6 +1036,7 @@ ZEND_FUNCTION(gmp_init)
>
> INIT_GMP_RETVAL(gmpnumber);
> if (convert_to_gmp(gmpnumber, number_arg, base TSRMLS_CC) ==
> FAILURE) {
> + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad number
> supplied");
> zval_dtor(return_value);
> RETURN_FALSE;
> }
>
> Any comments?
>
I would like to have float support rather than this dirty patch.
We may implement GMP float support. It would be easier with object.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net