Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73716 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51357 invoked from network); 17 Apr 2014 12:38:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Apr 2014 12:38:15 -0000 Authentication-Results: pb1.pair.com header.from=admacedo@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=admacedo@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.175 as permitted sender) X-PHP-List-Original-Sender: admacedo@gmail.com X-Host-Fingerprint: 209.85.213.175 mail-ig0-f175.google.com Received: from [209.85.213.175] ([209.85.213.175:57544] helo=mail-ig0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/61-39661-63BCF435 for ; Thu, 17 Apr 2014 08:38:15 -0400 Received: by mail-ig0-f175.google.com with SMTP id ur14so2206503igb.2 for ; Thu, 17 Apr 2014 05:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=SS2hl7WpjeAaSPlxTpgF6UpxnxlWDJZLWVzWs4nKeE4=; b=Iv1UWycUjKvfbdSMPQIydU4f45svD+JCQBnRXHSWHEzDKrUGmPj7D5wie0j1OO1iY0 eK3NZn7TCbKiPWUTGC/yIzzOUyY4RFQJpfC74bpajjdXvLJp3IPhJSomR3+NbxrqTNaT s/VZSBp8HoguLdZFPmQIykBcl0umBkWk/8bhHgcEj15L/Rpn4+FEXj9FhUYYt2+f8iMq bpqhndnw6LlWdVohEFp3QP8mYDk86qEf3bk+b5HzUdHLxd2ZDps+BDiuT+fMZggxNpaN UDQgZFd8lvYEJ3XsUNENyJlbFFRxEqhR/cuZSrlzL0mCBwTrsah4TqdsK6vr0N06afOw ncrA== X-Received: by 10.50.43.136 with SMTP id w8mr8288099igl.20.1397738292173; Thu, 17 Apr 2014 05:38:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.17.162 with HTTP; Thu, 17 Apr 2014 05:37:31 -0700 (PDT) In-Reply-To: <20140417122340.GS5587@phcomp.co.uk> References: <20140417122340.GS5587@phcomp.co.uk> Date: Thu, 17 Apr 2014 13:37:31 +0100 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary=089e011602a864e46204f73c4e5b Subject: Re: [PHP-DEV] Negative string offsets From: admacedo@gmail.com (Daniel Macedo) --089e011602a864e46204f73c4e5b Content-Type: text/plain; charset=UTF-8 Pretty interesting, but I'm sure this is (yet another) stepping stone until someone suggests the Python syntax for slicing strings and arrays :p On Thu, Apr 17, 2014 at 1:23 PM, Alain Williams wrote: > On Thu, Apr 17, 2014 at 01:01:44PM +0100, Leigh wrote: > > Hi Internals, > > > > What are peoples thoughts on allowing negative string offsets, that > return > > characters from the end of a string. > > > > Example: > > > > $string = 'foobar'; > > print $string[-1]; // prints 'r'; > > print $string[-2]; // prints 'a'; > > Good idea. > > -- > Alain Williams > Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT > Lecturer. > +44 (0) 787 668 0256 http://www.phcomp.co.uk/ > Parliament Hill Computers Ltd. Registration Information: > http://www.phcomp.co.uk/contact.php > #include > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e011602a864e46204f73c4e5b--