On Sat, Jan 17, 2015 at 4:32 AM, Andrea Faulds <a...@ajf.me> wrote:
> 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?

It looks to me like yet another can of worms (how do you deal with
conversions, mixed operations, etc. it adds a lot of special cases)
with little benefits. 32bit environments are dying species. There are
ways to support LFS without that as well (while I doubt the effort is
worth it). So if I'd to choose whether PHP should support unsigned
integer, my gut feeling right now is no, it should not.

Cheers,
-- 
Pierre

@pierrejoye | http://www.libgd.org

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to