Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94723 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60323 invoked from network); 27 Jul 2016 10:25:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2016 10:25:32 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.15 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.15 mout.gmx.net Received: from [212.227.15.15] ([212.227.15.15:56846] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/31-53289-B1C88975 for ; Wed, 27 Jul 2016 06:25:31 -0400 Received: from [192.168.2.103] ([217.82.227.154]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LdYdG-1b2Oqn1Axu-00io8i; Wed, 27 Jul 2016 12:24:43 +0200 To: Davey Shafik , will@wkhudgins.info References: <2a035597d443afb282e374aead55319d@wkhudgins.info> <99c50f35968001e99765a0c760e2b906@wkhudgins.info> Cc: David Rodrigues , PHP Internals Message-ID: Date: Wed, 27 Jul 2016 12:24:54 +0200 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:bBOBglAfPuPHXl/XqQEqTZJNZ5lHifuNrXQ61QuYi6Ony6feuB+ aC2boo4mpFupawWsDVwdhw+3rURYSI41N86GGFRuUlhGvoAGoVKo3qF8A8roodEVp8k0bAW 3MP13GKsThayVekWreelB//ypY/b+JocFaDnxFpPiCL8f6PYvUlCNr6kLloFfwVPi3zAiil 8heIyczD9LdiPbeNy5rsg== X-UI-Out-Filterresults: notjunk:1;V01:K0:PKBvivgNKvM=:eCTEyHoiH7UjiOIZmW8r// wtM6tlgqDZjyd6Nsv9DrFY3WaCFNN8Io1ZroAtjX2MlRBL+HwrCigJjZ3meZypuSfahT8mrZB TTJ+KeS6ieC8ePQrTnANXHN3OhmPid14zxnGRnuckjMIPu/n6VXaolm3ZhbXs2K5kxOeQ8+uB KG8l3ZgwCQYcCe75P1w/5QtfVUeZV829ACUQA3UbDvyYF2XcDHCH5uc11dBnMpSOFhV+Iim/O CTg1uKuE+boyfiaxSq84Ru+IVUWbNa3Vx2cLzhguEBygn+VOwqO4Pj6S0DesxSFXNcgbY1crF 6vEgupiKpIfQnlMD17pT5xLRyU410XllzFUB5xmtcVPFEBlp+TfEOoFCzTUjbhIsDf3knJI23 dRoepbhgNvh36/vwGY1ti+I4i4QhdDLEc95wbec4CcOkVnxhn9+JJ5lgovPUm57XiY942c6tK W2d+l3QQt/58bi1YVuzAEabf1gWvABO3Xmnaq+mIeq4q086UNlQhKCMk8+TgRvhyEDHZ8GmfJ FZOo8ZKoSpiTOhqeaKQy4rdE+yKWn6OMmm9xmi03r9/vKJyid1IKaHqsXqtoZ5uTKlsTn4KIL U04jPmREN/mYbpDNgI8aFGLFuUABK5VOYOEsdlgjIO4bot99kYwHAHbkn8UG5nK5sxu11rD44 FwzNSo+3fe+nfz1odsfp2EMLHahm/qUvr3B0XYJyYj1sHVqu2oSxelnaGe7mvgR8SJJcAp863 rq6tGEliEzG3dZc6Bp4fhfTz4bcvpfCRjmUb3xznspM66CAn4pLaglz4k4Q3YQqRzP2+3Dj4o R7+nm9G Subject: Re: [PHP-DEV] RFC Karma Request From: cmbecker69@gmx.de (Christoph Becker) On 27.07.2016 at 02:55, Davey Shafik wrote: > Ah, I missed that. If we had ranges (e.g. $string[0..4] or $string[-1..4]) > that'd work, but we don't. However, that still would require something like $str[0..mb_strlen($needle)-1] == $needle > Now I see some value in the function, though still perhaps not enough to > justify above and beyond strpos etc. One advantage of the new functions over userland implementations would be efficiency. A strpos() would still require to search the whole string if the $needle is not found. substr() and string slices would require a copy unless that would be optimized, if a general optimization is possible at all. Not sure, if I like to see yet two more string functions in the global namespace, though. -- Christoph M. Becker