Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13630 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34003 invoked by uid 1010); 30 Oct 2004 09:13:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 33975 invoked from network); 30 Oct 2004 09:13:11 -0000 Received: from unknown (HELO iko.gotobg.net) (80.168.8.116) by pb1.pair.com with SMTP; 30 Oct 2004 09:13:11 -0000 Received: from pd95192e8.dip.t-dialin.net ([217.81.146.232] helo=[192.168.0.6]) by iko.gotobg.net with esmtpa (Exim 4.43) id 1CNpIN-0004nN-T1; Sat, 30 Oct 2004 12:13:12 +0300 Message-ID: <41835A8E.4030007@hristov.com> Date: Sat, 30 Oct 2004 11:10:38 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a4) Gecko/20040918 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ilia Alshanetsky CC: internals@lists.php.net References: <418294D9.4070700@prohost.org> <20041029193421.9557.qmail@pb1.pair.com> <41832D13.7010308@prohost.org> In-Reply-To: <41832D13.7010308@prohost.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - iko.gotobg.net X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - hristov.com X-Source: X-Source-Args: X-Source-Dir: Subject: Re: [PHP-DEV] Re: Negative string offset support From: php@hristov.com (Andrey Hristov) Ilia Alshanetsky wrote: > Derick Rethans wrote: > >> How can you *need* this, you can use substr() just fine. > > > Almost no peace of functionality in PHP in unique, some extensions > duplicate core/standard functionality and vice versa. Usually the "core" > offers a simpler access to a resource and full pledged extensions gives > the full capabilities. The best example of this is streams, sockets > extension and cURL. > > On a similar note, most users don't use even 1/2 the functionality PHP > offers, does it mean we should remove those parts of the language or not > have add them in the 1st place? > > Just because substr() or $a[strlen($a) - 1] would work, it does not > mean they are the most optimal approaches. The change to permit negative > string offsets would require @ most 2-3 line change in Zend and it would > be trivial to write a series of tests to cover the affected code. We are > not talking about a major change here. > > Ilia > Privet Ilia, Andy mentioned that he tried in the past to separate {} and [] but after some unsuccess he left the idea of separating. So, the patch definitely won't be 2-3 lines of code. There are a lot of people which don't know about negative offsets at all, and use strlen() for calculations. Moving this feature to the language itself won't help them that much if just don't read the documentation ( as they do). Andrey