Re: cvs: php-src /ext/standard/tests/strings pack.phpt

From: Date: Tue, 21 Nov 2006 16:31:09 +0000
Subject: Re: cvs: php-src /ext/standard/tests/strings pack.phpt
References: 1 2 3 4 5 6 7 8  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41670@lists.php.net to get a copy of this message
A programmer generally packs an INT not 32bit or 64bit int and in PHP we don't fake overflow 64bit integers as a rule to simulate 32 bit behavior, I see no reason why pack() should be an exception to this rule. On 21-Nov-06, at 11:26 AM, David Soria Parra wrote:
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
--PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Ilia Alshanetsky

« previous php.cvs (#41670) next »