Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91050 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77711 invoked from network); 1 Feb 2016 21:06:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2016 21:06:27 -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.192.179 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.179 mail-pf0-f179.google.com Received: from [209.85.192.179] ([209.85.192.179:32790] helo=mail-pf0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/8A-07168-1D8CFA65 for ; Mon, 01 Feb 2016 16:06:27 -0500 Received: by mail-pf0-f179.google.com with SMTP id x125so90385975pfb.0 for ; Mon, 01 Feb 2016 13:06:25 -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=1TafAlMiFd5vNivx9uBAEjJT0BhylXAxR9XzYD6XeL0=; b=Lg07pbw21nMWpV6hgfCMQ5UZRf9MZ6+mgX9EDGyOelQBQZ1/Y0E9BrY0s+H1/anHXW 5BX1KNKHzbPhYw5BIDkdCKvZGkn96j94XLZHHL+XdmH1vrvMLaflr9zOgrzbZvtl+myH BiBpTEtv4HYbyhHJg0X/z9aUrUnxeIudroo44nytB/a/KQkJoIpLDSBu7HvVysTVGqDT z8x6wiZy1qmiTFZEIlS0cTX0bnv1jximiuSvv4tHDxiuDAhk3pqAbCgpA/6hjOGshzAG OQaZvNZFRgVHWcyEzZDfctNLyrpR0n0JJE34QnTVcCHZiU/9cZuquQlGrPR6ygnZE8mU BmXg== 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=1TafAlMiFd5vNivx9uBAEjJT0BhylXAxR9XzYD6XeL0=; b=cFMmt4Zmn51sagD+jOY/uotfDKCgTd+XKotN+Q5xenY1M4+r9HooS9QuPdD1FVnF6z Wu8/a2oduCOynYlxaPnBiLDvhKGpNIYnLzRJFSpWVDxSAzsocA5a6KaY9sbYefP9Ytns cYEipMyuOt82fJ0qDl13uEdBM8EVAK8dQLqQOtrZWkDULF24qtPK3LvfrxIlqI4YEExJ mGv4KFrvRYPsonD4S5V3fDmDLWNYXTsF7FW5nlfKBiruglvjB2k7z4TMeJF3IWya+/rp /QGuK3lGK/JKooV6JXtG3dcOl9qjbXZ7vZH/x3otS1FEcUbzT2iz5+SzsTmPGhMgUCHj gdYw== X-Gm-Message-State: AG10YORnYRVTbUloLs8ZueP7ZYWDVWuFaA6jRSVGHp6lmyjftfwapwaVvUP/gD2AsFN2hQ== X-Received: by 10.98.9.220 with SMTP id 89mr41597203pfj.17.1454360783319; Mon, 01 Feb 2016 13:06:23 -0800 (PST) Received: from Stas-Air.local ([2602:304:cdc2:e5f0:452c:520b:9c5d:5ee7]) by smtp.gmail.com with ESMTPSA id r80sm20672784pfi.9.2016.02.01.13.06.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Feb 2016 13:06:22 -0800 (PST) To: Nikita Popov References: <56A3A01F.1020500@php.net> <56AE8735.4070901@gmail.com> Cc: Internals X-Enigmail-Draft-Status: N1110 Message-ID: <56AFC8CC.6040201@gmail.com> Date: Mon, 1 Feb 2016 13:06:20 -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! > I strongly disagree with this. $str[$offset] is well-recognized, > generally understood syntax that does not require familiarity with > language peculiarities. $str{$offset} might be clear to a Perl > programmer, but to anyone else this is just guesswork, with a typo being > a reasonable assumption. The problem is that while it is generally understood, it's generally understood wrongly. $str[$offset] is not the same operation as $array[$offset]. There are many subtle differences. So while at the first sight it's similar, it leads to "understanding" that is only going to harm one in the future, when it turns out you really had wrong idea. I think it's much better to instill the right idea from the start, even if it means one has to take a brief look in the manual. String offset is *not* the same as array access. > We should be deprecating this alternative syntax instead of recommending > its use. I was under the impression that we *were* already discouraging > its use and it has already been temporarily deprecated. I think deprecating it was a mistake and give how much semantic load [] carries - array access, array constructor, now there's proposal to make it used in deconstructing too - adding string offset to it looks like bad idea. Different things should use different syntax, as much as possible. -- Stas Malyshev smalyshev@gmail.com