Re: cvs: php-src /ext/standard/tests/strings pack.phpt
| From: | David Soria Parra | Date: | Tue, 21 Nov 2006 16:26:49 +0000 |
| Subject: | Re: cvs: php-src /ext/standard/tests/strings pack.phpt | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-41669@lists.php.net to get a copy of this message | ||
I think a programmer that wants to pack an 32bit int (N - always 32 bit
integer, big endian) he expect the overflow and won't be influenced by
the internal cast to the 64bit long. In fact, if php would represent the
value as an C int on 64bit machines and not as long, the overflow would
also appear. So the developer who uses N option would get in fact a long
and not an int as promised by the manual. If the developer should be
aware of the internal representation of his integers as long, of course
no overflow would be the correct behaviour.
Am Dienstag, den 21.11.2006, 10:34 -0500 schrieb Ilia Alshanetsky:
> You cannot fake an overflow in all instances because some pack formats
> are machine size, and in those instances 64bit and 32bit results
> SHOULD differ.
>
>
>
> On 20-Nov-06, at 4:13 PM, David Soria Parra wrote:
>
> >
> >
> > So here is the correct version of the patch.
> > <pack.c.diff>
> > --
> > PHP CVS Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> Ilia Alshanetsky
>
>
>
>
>
>
>