Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91038 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6609 invoked from network); 31 Jan 2016 22:14:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2016 22:14:19 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.51 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.51 mail-pa0-f51.google.com Received: from [209.85.220.51] ([209.85.220.51:35633] helo=mail-pa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/C2-07168-A378EA65 for ; Sun, 31 Jan 2016 17:14:18 -0500 Received: by mail-pa0-f51.google.com with SMTP id ho8so70531866pac.2 for ; Sun, 31 Jan 2016 14:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=9wLHSGIiuAPJsith4P4THu6zpSKpZRGlYGdj2IdbEuM=; b=RrL8/QExk606OLR4QyqescXEB+kGtqB97tt5lsjzdR7izOlPzYZu/Z0W6GDQi/VObw u6aGUeXNidG7aE7oGIXYnF2pe2hIapwtLcIovBrlKWq5kmNh2Rw+ddgIzA1rlS4caPnD 2RiRu65H9RGh8FuKHqOR7TMwrEANwvknWmgiFMSjgSimeYgnHX+cW39MJKUyD9xvyTE4 13P6mLx5sxFYt/0Z0bDdJ0CQjHIDdirObgS4KqeAN+exTOa4/Wvbl0tCTzelRzMXG662 bu812mtQ+MLoyO7XSUkY284DC9osD1+7oJWS4BRB5IaXLp/nAdDWf7/zhKJr4Q6Mbmer afIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=9wLHSGIiuAPJsith4P4THu6zpSKpZRGlYGdj2IdbEuM=; b=QMMhC9NlFN6b2+Cub1JLekT/zPI5lBriWNj9S3ny5xCwNlvc9lGqfYW2mk1GuIVaK6 KWv/36NSv9bkF4QDZpSUpu0ujOy8bEfeDJX+vC79FbgjYQXpxQJQA227/b89heQ06G7b KM9p2A0pKEmoO9kQcWSAuV7W8S9zXVZubMfEEF/Rx8vVxWtgU/YdeniDrnz2R2VKrTjB GG7SeENJXcnXIEBFlQ0AhVS8Bwk9ki0bI6fX/FKhoYczKJ3zkbJwDsmN10gXGCP5N4qm nVPRIxJCqGEAlwD1mB+1k+ITM4Epw27hXhWR3Flg5LQeCQKJAL4Y4uZaFOJmawDdVwd3 QDSg== X-Gm-Message-State: AG10YOS8ODJx3XjzK7ZreR/+9ZpBZVjiagLdAt3ecMOYkJj1flXWoEhdoQJqSl10as6eHw== X-Received: by 10.66.236.129 with SMTP id uu1mr33043543pac.158.1454278455671; Sun, 31 Jan 2016 14:14:15 -0800 (PST) Received: from Stas-Air.local ([2602:304:cdc2:e5f0:452c:520b:9c5d:5ee7]) by smtp.gmail.com with ESMTPSA id ux2sm38039149pac.46.2016.01.31.14.14.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 31 Jan 2016 14:14:14 -0800 (PST) To: Nikita Popov References: <56A3A01F.1020500@php.net> Cc: Internals X-Enigmail-Draft-Status: N1110 Message-ID: <56AE8735.4070901@gmail.com> Date: Sun, 31 Jan 2016 14:14:13 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Generalize support of negative string offsets From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > The only concern I have is that support of negative indexing will break > symmetry with (proper) arrays, where we cannot support negative indexing. I think that was the main source of objections to this proposal in the past. However, as one might say, string offsets are already not symmetrical to array offsets - e.g. you can do $array["foo"] but not $string["foo"]. > However this is unlikely to be a significant issue. (I do however play with > the thought of reutilizing the obsolete {} indexing syntax to act as offset > indexing instead.) I think it may be a good idea to start recommending using {} for string offsets and [] for arrays. While both syntaxes may work for strings, the intent (and expected handling of negatives, in this case) is much clearer when different syntax is used. -- Stas Malyshev smalyshev@gmail.com