Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32708 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71010 invoked by uid 1010); 9 Oct 2007 06:13:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 70995 invoked from network); 9 Oct 2007 06:13:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Oct 2007 06:13:29 -0000 Authentication-Results: pb1.pair.com header.from=tony@daylessday.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tony@daylessday.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain daylessday.org designates 89.208.40.236 as permitted sender) X-PHP-List-Original-Sender: tony@daylessday.org X-Host-Fingerprint: 89.208.40.236 mail.daylessday.org Linux 2.6 Received: from [89.208.40.236] ([89.208.40.236:44877] helo=daylessday.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/00-04247-70C1B074 for ; Tue, 09 Oct 2007 02:13:28 -0400 Received: from [192.168.1.34] (ppp83-237-1-251.pppoe.mtu-net.ru [83.237.1.251]) by daylessday.org (Postfix) with ESMTP id 2EE8A640163 for ; Tue, 9 Oct 2007 09:33:31 +0400 (MSD) Message-ID: <470B12A6.20802@daylessday.org> Date: Tue, 09 Oct 2007 09:33:26 +0400 User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: 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> In-Reply-To: <00D6A914-81DE-406C-8DD0-9577A60DB496@gravitonic.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] substr/array_slice in [] From: tony@daylessday.org (Antony Dovgal) On 09.10.2007 06:32, Andrei Zmievski wrote: > I will use an example: > > $foo = substr($bar, 0, 5) . "-" . substr($bar, 5); > > or > > $foo = $bar[:5] . "-" . $bar[5:]; > > I would argue that the second line is hardly more cryptic than the > first one. How come? It looks like you're reading $bar[':5'], but forgot the quotes. On the other side, what could be easier than a function call? > And if we were concerned that concerned about duplicate > functionality, we probably wouldn't have SimpleXML and similar things. Mistakes done in the past do not mean we should continue to do them in the future. -- Wbr, Antony Dovgal