Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95108 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20296 invoked from network); 13 Aug 2016 07:42:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Aug 2016 07:42:44 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.230 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.230 mail4-3.serversure.net Linux 2.6 Received: from [217.147.176.230] ([217.147.176.230:59834] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/E6-55605-17FCEA75 for ; Sat, 13 Aug 2016 03:42:42 -0400 Received: (qmail 24711 invoked by uid 89); 13 Aug 2016 07:42:38 -0000 Received: by simscan 1.3.1 ppid: 24704, pid: 24707, t: 0.0760s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 13 Aug 2016 07:42:37 -0000 To: internals@lists.php.net References: <8442f1fa5544b2ca03e7cebbc64e8e5c@wkhudgins.info> Message-ID: <9ab63bd0-af85-29ec-8de3-1f212c54b954@lsces.co.uk> Date: Sat, 13 Aug 2016 08:42:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC Posted for str_begins and str_ends functions From: lester@lsces.co.uk (Lester Caine) On 04/08/16 06:50, Stanislav Malyshev wrote: >> I guess that "i" isn't appliable when it have slashes. >> > In this case, functions should be: strbegins, stribegins, strends, striends. >> > In all case, I think that is better a third parameter and keep underlined. > Please, not stribegins. We have enough functions with weird names :) > I am ambivalent of the question whether to have additional argument or > two functions, I guess with a slight preference for argument. The bulk of the time I'm applying this to the SQL query that is going to return a set of results rather than direct to a string. In that case it's STARTING 'xYZ'. Because the need has not arisen I've only just noticed - after 20 odd years - there is no matching ENDING. Although normally one needs to build a phantom field to index the data, so I do have ONE case of reversed_field STARTING 'ZYX'. Is starting just a Firebird SQL thing or is it more generally available. I do a few google searches but as usual when searching for things like 'starting' one gets hundreds of pages on 'running' the software and it's other connotations. I suspect like PHP the other methods of doing things take the strain, so certainly LIKE 'XYZ%' and '%XYZ' are probably the 'generic' solution but suffer from slower search times, especially when looking for the ENDING string. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk