Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76969 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33331 invoked from network); 30 Aug 2014 14:20:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2014 14:20:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.48 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.48 mail-qg0-f48.google.com Received: from [209.85.192.48] ([209.85.192.48:48782] helo=mail-qg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/A0-28092-6CDD1045 for ; Sat, 30 Aug 2014 10:20:55 -0400 Received: by mail-qg0-f48.google.com with SMTP id z107so3511502qgd.35 for ; Sat, 30 Aug 2014 07:20:51 -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=VtjGaE6HwCzqFhBpDfSN0QzNg4ellNCfV65KYQ/jGJo=; b=EvmfqegXChJ7qxLxtmlAXKjTB5OgyLiTBjxyFBBdq8onBpUFvt4ZOvzTp95qQTmTSI KzOH3KBgbsWNefxVBeBFuACxlrGO+ffmrmN/OkfHD21wCYgc0lsSeUT2wPbHDC3Antu+ JjzWw+pGocGyzOJUI/LeS+/z1KHfAfVQ8rRqkeWjUyOl8dLPrv/9HLBW0uzsMpQCIu2Y /rcpL3z7NtFbMD49278/ZmQ4oYHKTlcFLmUXyZC+kQ5Z/Y3rNni/CtQ3MP6VaKAuGzY4 rwo8ZMJLvvFyWIu3fDUvExWa9a7xJ8jtOHAburMSbxAldBzlITdpHNjgdvdB34MCk95/ aK/g== MIME-Version: 1.0 X-Received: by 10.224.75.73 with SMTP id x9mr28145252qaj.63.1409408451834; Sat, 30 Aug 2014 07:20:51 -0700 (PDT) Received: by 10.140.95.146 with HTTP; Sat, 30 Aug 2014 07:20:51 -0700 (PDT) Received: by 10.140.95.146 with HTTP; Sat, 30 Aug 2014 07:20:51 -0700 (PDT) In-Reply-To: <5401D0FA.1080505@beccati.com> References: <2afc5a878ff4c780c74f4604f77525c1.squirrel@webmail.klapt.com> <8642f96d780f339c448bd330c6e1c097.squirrel@webmail.klapt.com> <5401BB3D.4060000@beccati.com> <5401D0FA.1080505@beccati.com> Date: Sat, 30 Aug 2014 16:20:51 +0200 Message-ID: To: Matteo Beccati Cc: Dmitry Stogov , PHP internals , Anatol Belski , Nikita Popov , Chris Wright , Xinchen Hui Content-Type: multipart/alternative; boundary=001a11c303081d7cb90501d97a35 Subject: Re: [PHP-DEV] Re: 64 bit string offsets From: pierre.php@gmail.com (Pierre Joye) --001a11c303081d7cb90501d97a35 Content-Type: text/plain; charset=UTF-8 On Aug 30, 2014 3:26 PM, "Matteo Beccati" wrote: > > On 30/08/2014 14:03, Chris Wright wrote: > > On 30 August 2014 12:53, Matteo Beccati wrote: > >> Even though size_t allows "huge" strings, would it be so bad to throw an > >> error when one tries to create a string longer than 2^32 bytes, > >> regardless of memory_limit? > > > > This would be an unnecessary and somewhat arbitrary limitation. Yes, > > loading >2GB of *anything* into memory in PHP *probably* makes no > > sense (probably 99% of real-world installations have memory_limit set > > much lower than this anyway), but just because we cannot think of a > > valid use case does not mean there isn't one. > > > > If the string index deref issue cannot be solved, it can simply be > > documented as only working for offsets up to 2^31, but I personally am > > not in favour of imposing limitations on the size of a string for a > > non-technical reason. > > Well, the only use case I can think of for strings >2GB involves > modifying it in place. Crazy, but valid nonetheless. Too bad string > offsets can't be used for the part exceeding the 2GB limit ;) > > Non-working string offsets to me sounds like a technical reason and not something arbitrary. And the tech reason is? I do not know it yet but if it is only about using another type in the implementation it will not have any impact. But if it has an impact, let forget it, users should rely on stream then. Cheers, --001a11c303081d7cb90501d97a35--