Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49824 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79836 invoked from network); 30 Sep 2010 15:59:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Sep 2010 15:59:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=philip@roshambo.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=philip@roshambo.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain roshambo.org from 209.85.160.170 cause and error) X-PHP-List-Original-Sender: philip@roshambo.org X-Host-Fingerprint: 209.85.160.170 mail-gy0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:57330] helo=mail-gy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/32-04170-5E3B4AC4 for ; Thu, 30 Sep 2010 11:59:33 -0400 Received: by gyd10 with SMTP id 10so978801gyd.29 for ; Thu, 30 Sep 2010 08:59:31 -0700 (PDT) Received: by 10.231.146.136 with SMTP id h8mr4017504ibv.0.1285862370881; Thu, 30 Sep 2010 08:59:30 -0700 (PDT) Received: from [192.168.1.2] (c-76-22-32-17.hsd1.wa.comcast.net [76.22.32.17]) by mx.google.com with ESMTPS id h8sm3015ibk.9.2010.09.30.08.59.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Sep 2010 08:59:28 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <1285856042.16846.88.camel@guybrush> Date: Thu, 30 Sep 2010 08:59:26 -0700 Cc: Adi Nita , Andre Baumeier , Alex Baumann , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <7C196F31-CF01-47E2-9137-C7A46F275510@roshambo.org> References: <9A.BD.52399.493A28C4@pb1.pair.com> <1283691991.2190.2.camel@guybrush> <111C9250-40A5-4D82-9DD8-9B99D651D652@crossconcept.de> <1285853478.16846.85.camel@guybrush> <1285856042.16846.88.camel@guybrush> To: =?iso-8859-1?Q?Johannes_Schl=FCter?= X-Mailer: Apple Mail (2.1081) Subject: Re: [PHP-DEV] Built-in function: between From: philip@roshambo.org (Philip Olson) On Sep 30, 2010, at 7:14 AM, Johannes Schl=FCter wrote: > On Thu, 2010-09-30 at 16:37 +0300, Adi Nita wrote: >> Perhaps a better idea would be to group the ones that we already have >> under a common namespace. But this is no news, though. >=20 > Even then it would be unlikely that we add another special purpose > function. This would have to be an important feature, ringing huge > improvements in performance versus existing solutions (like preg_math) I can see (and always wish for) in_string() existing, but that's more = for naming reasons. Choosing strpos() or strstr() or some other random = string function for this common task feels dirty. Imagine if we had to = use arrpos() instead of in_array() ;) Also, since strpos() is our = official method, we must worry about 0 =3D=3D false. Sorry for hijacking this thread, but it feels related. As for between(), creating a cookbook of common tasks (and inserting = them into the manual) sounds reasonable. For example, we did something = like this for the plethora of array sorting functions: http://php.net/array.sorting Regards, Philip