Re: GMP object and is_scalar()
| From: | Yasuo Ohgaki | Date: | Mon, 30 Dec 2013 22:00:14 +0000 |
| Subject: | Re: GMP object and is_scalar() | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70935@lists.php.net to get a copy of this message | ||
Hi Robert,
On Tue, Dec 31, 2013 at 6:55 AM, Robert Stoll <php@tutteli.ch> wrote:
> I think __toScalar is way to wage, what will __toScalar() return? a bool,
> an int, a float or a string?
Not all classes should have __toScalar().
Only classes that should be evaluated as scalar should implement this magic
method.
Return values are programmer's choice.
Whatever scalar values may return.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net