Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85286 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86554 invoked from network); 20 Mar 2015 13:17:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2015 13:17:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.178 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.178 mail-we0-f178.google.com Received: from [74.125.82.178] ([74.125.82.178:33211] helo=mail-we0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/12-25408-10E1C055 for ; Fri, 20 Mar 2015 08:17:55 -0500 Received: by weop45 with SMTP id p45so81951754weo.0 for ; Fri, 20 Mar 2015 06:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=zK5/oi03VMJ9LhIVTaAwjIvT3af5kzxRxRnqUQaYLmQ=; b=sbdnhTLtXSZfyFQ4YRCx6FkwR8bhXFpdDWq7P7qt7wmjGYG30lCPN6mSSrDaDX3Ud6 HUvNsZQRwDl3rW/ItN0TZriF9MfZGsro3/ZCeGd+YIEeBhkuagNYkBQjS5XFqajlphhS YGy80ZzM0fLLxFxbAtLdjegzrvm6z8HU+k/IT2oZdnVVqtl63+uHjRafU8IuBTnilKFH w07z6EmXQSLJlD+fUCMQ8fAkNiPM+rQugOfGRpLQtS5CGS6EeF2TAhRHMMFffNj1NpNn Mhp8zDJTSEuCh9IhbAQZ0L4tLRVVog06iB7l4uUHimvdIk9tNaoyhBjWrwe+/UtmyAeG Hixg== X-Received: by 10.181.8.103 with SMTP id dj7mr5194344wid.75.1426857469578; Fri, 20 Mar 2015 06:17:49 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id ch6sm6356921wjc.3.2015.03.20.06.17.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Mar 2015 06:17:48 -0700 (PDT) Message-ID: <550C1DEC.5060706@gmail.com> Date: Fri, 20 Mar 2015 13:17:32 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Alex Bowers CC: internals@lists.php.net References: <550B5A81.1090706@gmail.com> <550B7189.4040608@gmail.com> <7486C296-7535-4633-AFE2-02E7BBC67BC5@gmail.com> <550C1176.9050307@gmail.com> <550C1AE4.8090607@gmail.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------010609080909030200030208" Subject: Re: [PHP-DEV] RFC - Array slice syntactic sugar From: rowan.collins@gmail.com (Rowan Collins) --------------010609080909030200030208 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Alex Bowers wrote on 20/03/2015 13:09: > > On 20 March 2015 at 13:04, Rowan Collins > wrote: > > $version{4:} = '7!'; > > > I'm sure this is a slight oversight on your end, but just to check. > The change of using {} instead of [] is not because its a string, and > is just a typo / example correct? It's an alternative syntax, which I thought was only usable for string indexing [1] but is apparently legal on arrays as well [2]. I personally like the idea of string offsets having similar but slightly different syntax from array offsets, to make clear which you're using. I use {} instead of [] for that reason, but at the moment the syntaxes are completely interchangeable as far as I can tell. [1] http://php.net/manual/en/language.types.string.php#language.types.string.substr [2] http://php.net/manual/en/language.types.array.php#language.types.array.syntax.accessing Regards, -- Rowan Collins [IMSoP] --------------010609080909030200030208--