Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39144 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18129 invoked from network); 21 Jul 2008 20:14:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2008 20:14:15 -0000 Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.178 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.178 mho-01-bos.mailhop.org Received: from [63.208.196.178] ([63.208.196.178:62556] helo=mho-01-bos.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/23-33868-61EE4884 for ; Mon, 21 Jul 2008 16:14:15 -0400 Received: from cs78255253.pp.htv.fi ([62.78.255.253] helo=[127.0.0.1]) by mho-01-bos.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KL1ls-000O8l-Db; Mon, 21 Jul 2008 20:14:12 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 62.78.255.253 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19QniAp3o1luM2F7SFBcnWtbvlPOsOIvRg= Message-ID: <4884EE17.6080501@sci.fi> Date: Mon, 21 Jul 2008 23:14:15 +0300 Reply-To: jani.taskinen@iki.fi User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: =?UTF-8?B?UGF3ZcWCIFN0cmFkb21za2k=?= CC: internals@lists.php.net References: <4884A18D.7090104@dealnews.com> <4884B89A.7040508@lerdorf.com> <200807212206.53954.pstradomski@gmail.com> In-Reply-To: <200807212206.53954.pstradomski@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] New string functions: str_startswith() and str_endswith() From: jani.taskinen@sci.fi (Jani Taskinen) Paweł Stradomski kirjoitti: > W liście Rasmus Lerdorf z dnia poniedziałek, 21 lipca 2008: >> It also isn't any shorter: >> >> if(str_endswith($path,'.php')) >> >> vs. >> >> if(substr($path,-4)=='.php') > > Only if comparing to a static string, but not for this case: > > if (substr($path, -strlen($extension)) == $extension) > > Readability would also increase. > You people are funny.. --Jani