Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77161 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15976 invoked from network); 12 Sep 2014 13:36:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Sep 2014 13:36:35 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.43 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.43 mail-qg0-f43.google.com Received: from [209.85.192.43] ([209.85.192.43:55895] helo=mail-qg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/61-01763-2E6F2145 for ; Fri, 12 Sep 2014 09:36:34 -0400 Received: by mail-qg0-f43.google.com with SMTP id a108so728797qge.30 for ; Fri, 12 Sep 2014 06:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=zobtuGWfqR3u6SWqIo3CmhwFoe48MaJQsSUbzmTNuek=; b=rcBseKgqIZfuIQ+G8O0BJ/QwG4z96YS4TaAGLnxStkwehTIHP01YctzfaNDH7zBSOd JW3sgVB/KAOhB4solZpkns6z+IbadvHcXuKX4IE60KCrlDtATaISIlYJ5rOv0BMd2Svq Zhg7qxZCF1pOobGAPfogy9nYRZdRAFWX4zi/dd4wr8R1EMKLygQeKr+6TEFc/Hor0Qdp SwRW9aFdB9vKB0gAbBH62HIrRjKguugOnJEm7bOaNu7nqjb33X+51FLN3JdECJffcfPe DnRrqz/kxy/S7Vvu+qGptxuIwA0+jRXlwdy+0g3lPCv5MCIt84QcDFghsMkLCwC3WFhU 0r/A== MIME-Version: 1.0 X-Received: by 10.224.4.73 with SMTP id 9mr12265395qaq.18.1410528991706; Fri, 12 Sep 2014 06:36:31 -0700 (PDT) Received: by 10.140.22.51 with HTTP; Fri, 12 Sep 2014 06:36:30 -0700 (PDT) Received: by 10.140.22.51 with HTTP; Fri, 12 Sep 2014 06:36:30 -0700 (PDT) In-Reply-To: References: Date: Fri, 12 Sep 2014 15:36:30 +0200 Message-ID: To: Leigh Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c21eda7f10ed0502de5f75 Subject: Re: [PHP-DEV] Re: pack() and unpack() 64 bit format codes From: pierre.php@gmail.com (Pierre Joye) --001a11c21eda7f10ed0502de5f75 Content-Type: text/plain; charset=UTF-8 On Sep 12, 2014 2:10 PM, "Leigh" wrote: > > On Sep 9, 2014 7:36 PM, "Leigh" wrote: > > > > Hi Internals, > > > > I would like to propose giving pack() and unpack() 64 bit format > > codes, mimicking the current behaviour of 32 bit format codes. > > > > Pack and unpack are obviously functions inspired by Perl, which has > > the 64 bit format codes 'q' and 'Q'. So the first half of my proposal > > is to give pack() and unpack() these options. > > > > q - signed long long (always 64 bit, machine byte order) > > Q - unsigned long long (always 64 bit, machine byte order) > > > > Perl does not have format codes to specify endianness, so the second > > half of my proposal is to introduce two more format codes for PHP that > > behave differently from Perl. > > > > J - unsigned long long (always 64 bit, big endian byte order) > > P - unsigned long long (always 64 bit, little endian byte order) > > > > I have chosen these letters _because_ they already exist in Perl, > > however their function does not suit PHP. J is for Perl internal > > integers, and P is for a pointer to a structure. Both of these are > > things that make no sense to support in PHP. > > > > I have ordered them so that J < P in the same way that N < V, > > hopefully making it a bit more intuitive for developers to remember > > what the codes mean (also P rhymes with V.. kinda) > > > > I don't think this requires an RFC, as it does not break any existing > > expected behaviour. > > > > I'd like to hear the lists opinion on introducing these new formatting > options. > > > > Provisional PR: https://github.com/php/php-src/pull/812 > > > > Cheers, > > > > Leigh. > > So, no objections? I would suggest to create a rfc as I am pretty sure many miss this thread (like me). It can the be used to document the new features if accepted. --001a11c21eda7f10ed0502de5f75--