Re: unsinged integer
| From: | Andrea Faulds | Date: | Sat, 17 Jan 2015 03:32:49 +0000 |
| Subject: | Re: unsinged integer | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80672@lists.php.net to get a copy of this message | ||
Hi Marc,
This is an unusual follow-up from me.
Particularly on 32-bit systems, it would be useful to have a ‘u’ zend_parse_parameters specifier
for an unsigned integer. Unfortunately, again, I don’t think native unsigned integers (IS_ULONG)
will get into PHP. But it looks like the bigint RFC probably will, and here’s the opportunity.
With the bigint RFC, we could add a ‘u’ specifier. You’d get a native ulong (zpp would convert
from long or bigint), and could easily produce a long/bigint from your ulong if you need to return
one (add RETURN_ULONG which implicitly converts?).
Now, it’s not as fast as a native IS_ULONG type would be, but we could still do things like
properly support file sizes in the 2GB-4GB range on 32-bit, at least. :)
What do you think?
--
Andrea Faulds
http://ajf.me/