Re: GMP object and is_scalar()
| From: | Stas Malyshev | Date: | Mon, 30 Dec 2013 22:20:23 +0000 |
| Subject: | Re: GMP object and is_scalar() | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70938@lists.php.net to get a copy of this message | ||
Hi!
> Should it? PHP is weakly typed language.
That doesn't mean types do not exist. That means values can be converted
from type to type, but there's no type "scalar" - it is just a group
name of a set of types.
> One thing clear to me is users expects GMP numbers behave like
> scalar numbers most likely.
I don't think users expect anything like that, I don't see legitimate
use case why users would expect is_scalar return true on GMP object. If
the user is advanced enough to use is_scalar he should understand what
that function does. Or user some other function that is more fit for
their goals.
> Yet another option for PHP 5.6 is to note GMP numbers as
> EXPERIMENTAL.
GMP is in PHP for a long time, why would it suddenly become experimental?
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227