Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39143 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16205 invoked from network); 21 Jul 2008 20:08:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2008 20:08:26 -0000 Authentication-Results: pb1.pair.com header.from=pstradomski@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pstradomski@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.189 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pstradomski@gmail.com X-Host-Fingerprint: 209.85.128.189 fk-out-0910.google.com Received: from [209.85.128.189] ([209.85.128.189:38971] helo=fk-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/C2-33868-F8CE4884 for ; Mon, 21 Jul 2008 16:08:12 -0400 Received: by fk-out-0910.google.com with SMTP id 18so999273fks.7 for ; Mon, 21 Jul 2008 13:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=0o3PKFg8RKEO5EYeAHYqJ4B4kOML62GaUhXKTtHXuPw=; b=bhQQIAXUF5JFFyiotNOMdGMl49WN3tIevf897tSQgt9ve8xeZ1yHXwCyHLlpy2WlGw +pnLOsoOa3t8NCHzg1jPGdDRcgiaDRuumZyz5fgCtCf2Jg9W5rcOwMcK29bdtRr2IWrv xjrhGqfH3ybhUyhYKTtFWLDfaWIxGl4YyVb18= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=rQ2X3oJ6lWQ7ualRirCskkOauZgTQR7+ouAq/Vlnv1Mtf29iKwXvBxJI/PZjbaqaY2 cH5Lx8/oGCjLvpsCVbN9nUMT+EznSvcCQk1207DKIIeu3O4E4MwkK2S2dbGS+44zbdCu 5mslAEKYTDozj/qpm/TaqD0mijgPun7rf0AOs= Received: by 10.181.22.8 with SMTP id z8mr2247530bki.78.1216670825073; Mon, 21 Jul 2008 13:07:05 -0700 (PDT) Received: from deimos ( [91.196.215.2]) by mx.google.com with ESMTPS id k29sm14964012fkk.2.2008.07.21.13.07.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Jul 2008 13:07:04 -0700 (PDT) Reply-To: =?utf-8?q?Pawe=C5=82_Stradomski?= To: internals@lists.php.net Date: Mon, 21 Jul 2008 22:06:53 +0200 User-Agent: KMail/1.9.9 References: <4884A18D.7090104@dealnews.com> <4884B89A.7040508@lerdorf.com> In-Reply-To: <4884B89A.7040508@lerdorf.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-ID: <200807212206.53954.pstradomski@gmail.com> Subject: Re: [PHP-DEV] New string functions: str_startswith() =?utf-8?q?and=09str=5Fendswith?=() From: pstradomski@gmail.com (=?utf-8?q?Pawe=C5=82_Stradomski?=) W li=C5=9Bcie Rasmus Lerdorf z dnia poniedzia=C5=82ek, 21 lipca 2008: > It also isn't any shorter: > > if(str_endswith($path,'.php')) > > vs. > > if(substr($path,-4)=3D=3D'.php') Only if comparing to a static string, but not for this case: if (substr($path, -strlen($extension)) =3D=3D $extension) Readability would also increase. =2D-=20 Pawe=C5=82 Stradomski