Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38269 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51642 invoked from network); 16 Jun 2008 06:46:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jun 2008 06:46:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Received: from [66.11.173.122] ([66.11.173.122:21611] helo=interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/17-06776-62C06584 for ; Mon, 16 Jun 2008 02:45:59 -0400 Received: from [192.168.1.3] (blobule.suds [192.168.1.3]) by interjinn.com (Postfix) with ESMTP id 4D7A611FB6D; Mon, 16 Jun 2008 02:45:52 -0400 (EDT) To: Arvids Godjuks Cc: Chris Stockton , Andi Gutmans , Lars Strojny , Markus Fischer , PHP Developers Mailing List In-Reply-To: <9b3df6a50806152320l71581b0dmefe2ccc63766d2e5@mail.gmail.com> References: <77972256-ED0C-4FCE-8DEF-8283FE1BBFC5@roshambo.org> <484F0897.4040405@fischer.name> <1213139582.12765.5.camel@localhost> <698DE66518E7CA45812BD18E807866CE01AB3D1D@us-ex1.zend.net> <9b3df6a50806152320l71581b0dmefe2ccc63766d2e5@mail.gmail.com> Content-Type: text/plain Organization: InterJinn Date: Mon, 16 Jun 2008 02:45:55 -0400 Message-ID: <1213598755.8898.4.camel@blobule> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1.1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] deprecation status of $str{42} versus $str[42] From: robert@interjinn.com (Robert Cummings) On Mon, 2008-06-16 at 09:20 +0300, Arvids Godjuks wrote: > 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. You must have skipped some of the messages in this thread... such as the following one: http://marc.info/?l=php-internals&m=121315757406465&w=2 Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP