Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32716 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96940 invoked by uid 1010); 9 Oct 2007 16:43:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 96924 invoked from network); 9 Oct 2007 16:43:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2007 16:43:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:37814] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/EE-03565-1AFAB074 for ; Tue, 09 Oct 2007 12:43:16 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 9 Oct 2007 18:43:05 +0200 Received: from [127.0.0.1] ([192.168.17.25]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 9 Oct 2007 09:42:59 -0700 Message-ID: <470BAF8B.6030509@zend.com> Date: Tue, 09 Oct 2007 09:42:51 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Alexey Zakhlestin CC: Antony Dovgal , internals@lists.php.net References: <200710042005.30734.larry@garfieldtech.com> <285930281.20071006200938@marcus-boerger.de> <200710061338.47307.larry@garfieldtech.com> <4707D8AA.9060905@daylessday.org> <00D6A914-81DE-406C-8DD0-9577A60DB496@gravitonic.com> <470B12A6.20802@daylessday.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Oct 2007 16:42:59.0720 (UTC) FILETIME=[73AC4880:01C80A93] Subject: Re: [PHP-DEV] substr/array_slice in [] From: stas@zend.com (Stanislav Malyshev) > operator is definitely easier because it lets us reuse the same syntax > for strings and arrays (and people would need to learn one operator Having same syntax mean two different things (string access / array access) doesn't qualify as "easy" in my book anyway. I know there's a language which uses only 8 characters for everything (since this is a family-oriented mailing list, I'm not going to mention it by name ;) - but it is hardly easy. I would be kind of OK if we made substring operator be {X:Y}, but for array operator I don't really see how it's substantially better than calling array_splice. It has a bit less characters to type, but less typing is not always better. It also doesn't make sense in a lot of array contexts (what is $a["apples":"oranges"]?) so it doesn't extend old [] syntax naturally. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com