Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62642 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88553 invoked from network); 2 Sep 2012 00:43:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2012 00:43:04 -0000 Authentication-Results: pb1.pair.com header.from=slevy1@pipeline.com; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=slevy1@pipeline.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pipeline.com from 209.86.89.68 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: slevy1@pipeline.com X-Host-Fingerprint: 209.86.89.68 elasmtp-masked.atl.sa.earthlink.net Linux 2.4/2.6 Received: from [209.86.89.68] ([209.86.89.68:57070] helo=elasmtp-masked.atl.sa.earthlink.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E7/9B-17065-79BA2405 for ; Sat, 01 Sep 2012 20:43:04 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=pipeline.com; b=X0BNas7Pi6wa8ASlwttjI8hluW47rfX0vqcwtTvFsnR6UD6b/m/zhgzv+yCR5uRa; h=Message-ID:Date:From:Reply-To:To:Subject:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:X-ELNK-Trace:X-Originating-IP; Received: from [209.86.224.67] (helo=wamui-haziran.atl.sa.earthlink.net) by elasmtp-masked.atl.sa.earthlink.net with esmtpa (Exim 4.67) (envelope-from ) id 1T7yHF-0004t5-9W for internals@lists.php.net; Sat, 01 Sep 2012 20:43:01 -0400 Received: from 216.175.87.42 by webmail.c.earthlink.net with HTTP; Sat, 1 Sep 2012 20:43:00 -0400 Message-ID: <13095916.1346546580825.JavaMail.root@wamui-haziran.atl.sa.earthlink.net> Date: Sat, 1 Sep 2012 17:43:00 -0700 (GMT-07:00) Reply-To: slevy1@pipeline.com To: internals@lists.php.net Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: EarthLink Zoo Mail 1.0 X-ELNK-Trace: ad108fc9e0b7e924cd4e711cd2c36696836f38a9c52816ae32ba7ea1bb5438da3775e82f6ae4676c350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 209.86.224.67 Subject: Re: Support negative indexes for arrays and strings From: slevy1@pipeline.com The idea was originally proposed by Marc Easen who created a patch and asked for help with putting together an RFC. I have yet to see a formal proposal but on the list Easen modified his idea so that it should apply to strings alone. With that in mind, would it really cause problems to have code like this: $string = "Roses are red"; $string[-3] = "R"; // modifying $string[10] echo $string; // Roses are Red The negative indexing provides a pleasurable way to easily access part of a string; it's simple and should be fast, too. I think Easen's proposal is laudatory and I for one would like to see it happen for PHP and provide users with more ease and satisfaction in working with the language. SL