Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95292 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4875 invoked from network); 18 Aug 2016 11:42:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2016 11:42:03 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:37334] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BC/E2-19643-A0F95B75 for ; Thu, 18 Aug 2016 07:42:03 -0400 Received: by mail-wm0-f53.google.com with SMTP id i5so27669978wmg.0 for ; Thu, 18 Aug 2016 04:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=VDbnS4L+deLsxQtNa0MFOp7JfvdCbL/Hr76MC174vAw=; b=bcnac5bAwCHUSv8cWGcSreysjuOp3IXvC4J0ITq+fAk3Ke5LAiLcz2fr4idse+NDeo 1lVFJRkIhOROkHJzEs9QpfGeu5PTnHDwj1dzm/3Qgzl2C0w/2KKSJHEK66cQrVr1GLWi OIgVAqY9/h5va9ypTnPy++OpzmBb4ZVhJsT/f96BsRUgrJRHcGFlSJYGWzIr7n+DqJMS bZyKJm4f/xlbD4cmoCKsiQbehW/8IsqeCGTrmnCvPgV0aiOdhLPhZSxq/7RrAXti5E8s +HnOIpqkv3P3SC7W9HkyHvgucPAE5NS/eTyAQnTlB9jCgJY6r6oQldI8Yv6ZP6gY1dvb 7XJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=VDbnS4L+deLsxQtNa0MFOp7JfvdCbL/Hr76MC174vAw=; b=XcbAv8Xvwaqt+tG2GZsCPhDh9JAUq62iAQYhGUU+uZubjNW2OTEUMFNLRkm8ylFhap VlnYn84Ad5l9/aeC8Bxgt3N0eBs+r7nAM0Sgq58AkQo3/LgHs06ayD5hXihirq+in56M hOp3KwuBYeyxaL5D8Mhf2mn1FfOnWNk/mIWikQTmdYcdrjNDUJJJ3hr1hsnagV9qFQ9a 0lqGVkY/WA7H8l3IDVSf9EtFt9+6OiwiN/eExEHh5toAdRn78hSSHawU+2ki0fvnJPh3 OlvlVDeF9fVnUXdFb0WsdlEpDXkuteP3od2U3JRwx4k37l74IXWmoIMRD8ovrN/l6q3H gi+w== X-Gm-Message-State: AEkoouvpEeulNe1j8T/kTTVkOdbhoR9mcJRyd39Rq8vM+zLVKvihl7y8cC0AVbytnYSMnQ== X-Received: by 10.194.190.232 with SMTP id gt8mr1829187wjc.141.1471520519516; Thu, 18 Aug 2016 04:41:59 -0700 (PDT) Received: from [192.168.0.98] ([93.188.182.58]) by smtp.gmail.com with ESMTPSA id a2sm1838781wjg.46.2016.08.18.04.41.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 04:41:58 -0700 (PDT) To: internals@lists.php.net References: <8442f1fa5544b2ca03e7cebbc64e8e5c@wkhudgins.info> <9ab63bd0-af85-29ec-8de3-1f212c54b954@lsces.co.uk> Message-ID: <6ce96cbb-fbf7-fe18-a43a-cafed7f21f7c@gmail.com> Date: Thu, 18 Aug 2016 12:39:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <9ab63bd0-af85-29ec-8de3-1f212c54b954@lsces.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] RFC Posted for str_begins and str_ends functions From: rowan.collins@gmail.com (Rowan Collins) On 13/08/2016 08:42, Lester Caine wrote: > 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've never come across it in Postgres, MS SQL Server, or MySQL. Generally LIKE 'abc%' is the recommended approach (and will I think hit the index in many cases, because the DBMS can optimize the case of a prefix match if it knows at planning time). A "starting" keyword would certainly be useful if it was there. :) It doesn't quite fill the same need as a PHP function, of course, because you might be checking user input, or API results, or all sorts of things that won't, or haven't yet, hit the database. Currently the common idiom for that is the ugly strpos($string, 'abc') === 0 Regards, -- Rowan Collins [IMSoP]