FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » signed int64 pack/unpack
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: signed int64 pack/unpack [message #184621 is a reply to message #184612] Mon, 13 January 2014 01:59 Go to previous messageGo to previous message
Ben Bacarisse is currently offline  Ben Bacarisse
Messages: 82
Registered: November 2013
Karma:
Member
Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:

> On 1/12/2014 5:35 PM, Ben Bacarisse wrote:
>> Jerry Stuckle <jstucklex(at)attglobal(dot)net> writes:
>> <snip>
>>> Yes, I know. But he keeps referring to information that is > 15 years
>>> old. PHP has changed a lot since then, but we just wants to argue.
>>
>> Old information can be accurate. I don't know if it is in this case,
>> but it explains the OP's results better than the more recent PHP
>> documentation does. When I asked you your opinion of what's happening,
>> you went all angry and weird.
>>
>
> Exactly. You don't know if the information is accurate. Yet you
> continue to argue about it.
>
> And more recent PHP documentation is more accurate because it relates
> to the CURRENT code base, not one that is over 15 years old.

I could not find an explanation in the PHP documentation. I am sure it
is more up-to-date (and more applicable) but there was no answer there
that I could see.

As it happens, the current code base references Perl for the behaviour.
A comment at the start of pack.c says:

/* pack() idea stolen from Perl (implemented formats behave the same as there)
* Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
*/

So the code authors would have pointed me to Perl's pack function had I
not already gone there and, as documented, the code for the i and I are
based on the size of a C int (on the build system):

case 'i':
case 'I':
while (arg-- > 0) {
php_pack(argv[currentarg++], sizeof(int), int_map, &output[outputpos]);
outputpos += sizeof(int);
}
break;

> As for getting "angry and weird" - maybe I'm just tired of arguing
> with people who base their position on old and/or inaccurate
> information (or translation thereof), and refuse to look at any other
> possibility.

I am open to other possibilities. What is your opinion about what i and
I do and the size of integer they work with?. I didn't pretend to know
what is actually going on, just what seemed to be going on.

--
Ben.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how did I wind up with double headers?
Next Topic: Switch question
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 16:40:53 GMT 2024

Total time taken to generate the page: 0.07512 seconds