Re: GMP object and is_scalar()
| From: | Yasuo Ohgaki | Date: | Mon, 30 Dec 2013 21:35:57 +0000 |
| Subject: | Re: GMP object and is_scalar() | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70932@lists.php.net to get a copy of this message | ||
Hi Stas,
On Tue, Dec 31, 2013 at 6:31 AM, Stas Malyshev <smalyshev@sugarcrm.com>wrote:
> > Since this (GMP numbers work like normal numbers) is new feature, we
> > may choose better option.
>
> I think you're taking it way too far. GMP numbers may support some
> functions that scalars support, but that does not mean every function -
> especially functions with are *specifically designed* to distinguish
> scalars from objects - would do the same thing for them as for scalars.
> If you're interested in their "numeric" properties - i.e. adding them,
> multiplying them, etc. - fine, they work that way. But if you "pop the
> hood" and look inside - no, they should not be scalars inside, because
> they are not.
I agree with your opinion in general.
How about to introduce scalar object that is evaluated as scalar?
It would be useful in user land also.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net