Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39140 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6529 invoked from network); 21 Jul 2008 19:28:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2008 19:28:57 -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.163 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:36229] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/D0-33868-BAED4884 for ; Mon, 21 Jul 2008 15:08:27 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 21 Jul 2008 22:08:57 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 21 Jul 2008 12:08:54 -0700 Message-ID: <4884DEC6.9050908@zend.com> Date: Mon, 21 Jul 2008 12:08:54 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Rasmus Lerdorf CC: Stan Vassilev | FM , internals References: <1216514217.11114.6.camel@localhost> <488295AC.3000107@lerdorf.com> <13F3C3E0FB864C919A2048D507EDB9B9@pc> <48834C31.80806@lerdorf.com> <3025CCBD79414CB2BC9BE1ED3132568C@pc> <4884A18D.7090104@dealnews.com> <4884B89A.7040508@lerdorf.com> In-Reply-To: <4884B89A.7040508@lerdorf.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Jul 2008 19:08:54.0375 (UTC) FILETIME=[37FF1F70:01C8EB65] Subject: Re: [PHP-DEV] New string functions: str_startswith() and str_endswith() From: stas@zend.com (Stanislav Malyshev) Hi! > It also isn't any shorter: > > if(str_endswith($path,'.php')) > > vs. > > if(substr($path,-4)=='.php') Doesn't substr allocate new string for ".php"? Then endswith can have one advantage of not requiring any new allocations. Not sure it's enough to add it, but a point here to consider. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com