Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76956 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72002 invoked from network); 29 Aug 2014 16:34:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Aug 2014 16:34:52 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.46 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.46 mail-la0-f46.google.com Received: from [209.85.215.46] ([209.85.215.46:60119] helo=mail-la0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/48-22920-AABA0045 for ; Fri, 29 Aug 2014 12:34:51 -0400 Received: by mail-la0-f46.google.com with SMTP id pv20so3027071lab.33 for ; Fri, 29 Aug 2014 09:34:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=aYmgXDALdy07Q0elJByU49w+xwTDE4FOwcqp1Z306fo=; b=W4Yv/QZLNCiJU7PGoW+glYQTygHDO+fEBbvd5MlZu6Ap9loHUEhTsIsWn2Mbkwro0a HDWXkFrRybd2Ck+k6yS3hFs8y+7tF/z4znjjBEOxdLNSIM7IUHnj2S8wYfUmWFLxgxFS u56dR1wwxo/G68hXQQDqwixPQjtAAUzjU7OGTuS/Li1PJERqKAIW/XAu0xGDGiB988tE zAqyU20zDftccv5bbE5arcshjFlKBOX9+nILTULmggpYEY2ekz/Iclu7War0woP/Z338 o49Dz9+H1xm9MUKNndEkhlEXM3jExxXBBQBIbrTHUfcBpagzxxwpyfyKe7LFc0gJvjMJ RYaw== X-Gm-Message-State: ALoCoQlKHxlqKb6kGOoYhMEYKRPMUe4MRR1/Ra2aONuIQR18YHDyhhVuZLRHD70W6iNXTC0/vG3/RnMqNh+YXKINUbHcQxnl+E7PUMgPLFrUGL1Wja6HlmyHkmiweZ9ePaIkty2Cy6vxlSLOaCfz03pAaUzwRJbzaQ== X-Received: by 10.112.76.230 with SMTP id n6mr11885153lbw.8.1409330087538; Fri, 29 Aug 2014 09:34:47 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx.google.com with ESMTPSA id tc8sm697233lbb.8.2014.08.29.09.34.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Aug 2014 09:34:45 -0700 (PDT) Received: by mail-lb0-f169.google.com with SMTP id l4so2918672lbv.14 for ; Fri, 29 Aug 2014 09:34:45 -0700 (PDT) X-Received: by 10.112.150.106 with SMTP id uh10mr11521475lbb.11.1409330085329; Fri, 29 Aug 2014 09:34:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.187.72 with HTTP; Fri, 29 Aug 2014 09:34:25 -0700 (PDT) In-Reply-To: <2afc5a878ff4c780c74f4604f77525c1.squirrel@webmail.klapt.com> References: <2afc5a878ff4c780c74f4604f77525c1.squirrel@webmail.klapt.com> Date: Sat, 30 Aug 2014 00:34:25 +0800 Message-ID: To: Anatol Belski Cc: PHP Internals , Nikita Popov , Pierre Joye , Dmitry Stogov Content-Type: text/plain; charset=UTF-8 Subject: Re: 64 bit string offsets From: laruence@php.net (Xinchen Hui) On Fri, Aug 29, 2014 at 11:49 PM, Anatol Belski wrote: > Hi, > > while refining the big string support, it turned out that we've an issue. > The syntax like $s[42] = 'x'; is currently inconsistend, because we have > uint32 for string offsets. This actually means, the behaviour is currently > only available in the old style and can handle not more than 2gb big > strings. > > Also discussed with Laruence on IRC and he actually expressed the concern > that we pay overhead on that. From my side I was investigating on that and > could suggest several solutions for that: > > - stay with the old behavior (indexes would be able to handle only 2gb > strings, this is the status quo) I think it's okey. maybe throw a warning if it's bigger than 32bits? if a string is bigger than 2^32... I think there must be a bug.... :) thanks > - implement a function like in JS String.charAt() as alternative > - turn to some temp_variable solution we currently have in PHP5. Laruence > told be that dropping temp_variable was one of the improvementes. > Actually, the string index functionality is utilized in two opcodes, so > maybe that were just a local case. > > Anyway not talking about touching zval, as that would grow by 8 bytes with > a size_t str_offset. Just maybe there were another solution I oversee? > > Regards > > Anatol -- Xinchen Hui @Laruence http://www.laruence.com/