Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38267 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45311 invoked from network); 16 Jun 2008 06:20:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2008 06:20:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=arvids.godjuks@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arvids.godjuks@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.175 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arvids.godjuks@gmail.com X-Host-Fingerprint: 66.249.92.175 ug-out-1314.google.com Received: from [66.249.92.175] ([66.249.92.175:28805] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/B5-06776-72606584 for ; Mon, 16 Jun 2008 02:20:24 -0400 Received: by ug-out-1314.google.com with SMTP id h3so326449ugf.29 for ; Sun, 15 Jun 2008 23:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=FLd0Cs4+0XSJ9Q1AMj1qaJd/fPBISouimkRVzBhT900=; b=eeWsBCc2N82iNClu5yfKKa/bLxTaDrMeJbkChZQAr3RvEOSN0M+dVV9bq3aKHm69KD cqIgtGG/BW+2xmbxVGkix0n0yhIJXIPN7TWoToDjuRvwn0+PaYwvYyVZLNsCBMz3bPEO 7gv01cIFSrmcCLCKPRHxShBFRkLf4b+bQlADY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=enCBVEACawz1Wrbdj90wM2yIdo1bcIzF9joRO+If/rXIsOvW4/D5HJEi+Qdu8j9HnW EM4BT2PTnSP/bhQ+0bFZatPspLEdknRaKPZzbDXJjwphJqmznnrUmx0X8+rc9elIJAnw oBQIfQYF33fonSFi1mBwqKlxJFuPA6OeR9TgU= Received: by 10.66.233.10 with SMTP id f10mr5387262ugh.17.1213597220428; Sun, 15 Jun 2008 23:20:20 -0700 (PDT) Received: by 10.66.223.2 with HTTP; Sun, 15 Jun 2008 23:20:20 -0700 (PDT) Message-ID: <9b3df6a50806152320l71581b0dmefe2ccc63766d2e5@mail.gmail.com> Date: Mon, 16 Jun 2008 09:20:20 +0300 To: "Chris Stockton" Cc: "Andi Gutmans" , "Lars Strojny" , "Markus Fischer" , "PHP Developers Mailing List" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11332_27097321.1213597220452" References: <77972256-ED0C-4FCE-8DEF-8283FE1BBFC5@roshambo.org> <484F0897.4040405@fischer.name> <1213139582.12765.5.camel@localhost> <698DE66518E7CA45812BD18E807866CE01AB3D1D@us-ex1.zend.net> Subject: Re: [PHP-DEV] deprecation status of $str{42} versus $str[42] From: arvids.godjuks@gmail.com ("Arvids Godjuks") ------=_Part_11332_27097321.1213597220452 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2008/6/14 Chris Stockton : > > I personally have always used {} for string offsets because it just felt > right. [] seems like it is for arrays, for me, using it on strings makes me > feel dirty. > > Could we maybe visit some of the ideas you have had with {} syntax offering > some benefit? That I do not completely understand and would be nice to know > what you mean. > > Maybe something like built in substr? since it wouldn't break existing use > of {}, tough thing is the ambiguity between {1} regular and {1} substr, > dunno: > $str = "abcdef"; > $result = $str{1}; // returns b, but substr would be something like bcdef > $result = $str{1, 2} // returns bc, this we know what to return for sure > $result = $str{1,} // maybe to make up for lack of {1} returning remaining > portion, its a little ugly almost feels like a syntax error > > Just trying to figure out how you could have technical benefit with it, > maybe you just meant performance optimization or something. > > -Chris > String is an array of chars, always was and is such in any programming language. So I see argument for {} as missing knowledge for some programming basics. And I don't understand why are you arguing on this. This was decided for removal long ago - so just do it. ------=_Part_11332_27097321.1213597220452--