Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51777 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50607 invoked from network); 31 Mar 2011 17:58:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Mar 2011 17:58:45 -0000 Authentication-Results: pb1.pair.com header.from=martinscotta@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=martinscotta@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: martinscotta@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:49480] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CD/34-27840-5D0C49D4 for ; Thu, 31 Mar 2011 12:58:45 -0500 Received: by vwl1 with SMTP id 1so2290955vwl.29 for ; Thu, 31 Mar 2011 10:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=immwyLKlwleIAu0AKfkiXvB88UdAzBqOKFkwUy4Wsn0=; b=QNk9ivR4+Ony0RHCts4Ofc+X6ouV+G+Ru54qZF5M94Q96tUzrwzeTZ7jyPfBM9eGYZ AGa6/B90Qxok4zxEjWJZ0DlZsk9UHgFqNg6ouz1GHrMr3S/18TfaiyACguJLUCyyvKci gA6TORn6Mk9DDHo8Qshh7/lIjJjdFe3uzEi+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=mNW/IkeEFWbU9F94OBSYuO39bz8BwJUyekk53vRf1+NnhnuNEXRQJfjmTnVIwfoQ2U vU9jhN1raGeUNXsB+E6nfOt8OsBpGroeaAcB31Zd/ElGa7NNdkfQPysCwbc00rHGn1KD S9SiVX1SnpNIkar1d9D1n5JgX5NfpqBsbwjTQ= MIME-Version: 1.0 Received: by 10.52.98.97 with SMTP id eh1mr3962750vdb.148.1301594322623; Thu, 31 Mar 2011 10:58:42 -0700 (PDT) Received: by 10.220.176.199 with HTTP; Thu, 31 Mar 2011 10:58:42 -0700 (PDT) In-Reply-To: <4D94A350.70201@lerdorf.com> References: <4D92CC38.5040900@toolpark.com> <004301cbeee8$e54a8280$afdf8780$@com> <4D9387BE.4030808@divbyzero.net> <4D94984D.8060700@lerdorf.com> <4D94A111.7050501@moonspot.net> <520FB834-2614-4873-AC3B-0B2594B18471@roshambo.org> <4D94A350.70201@lerdorf.com> Date: Thu, 31 Mar 2011 14:58:42 -0300 Message-ID: To: Rasmus Lerdorf Cc: Philip Olson , Brian Moon , Martin Jansen , Dan Birken , internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf307d046c3ddbde049fcb0b8f Subject: Re: [PHP-DEV] Adding a more logical string slicing function to PHP From: martinscotta@gmail.com (Martin Scotta) --20cf307d046c3ddbde049fcb0b8f Content-Type: text/plain; charset=ISO-8859-1 I think it's time to stop thinking in terms of "functions" and move forward to "abstractions" $s1 = 'string'; $s1->contains($s2); $s1->indexOf($s2) === strpos($s1, $s2); Why can't the strings be exposed as pseudo-objects ? users can choose to use them as a regular strings or by calling methods on it. Martin Scotta On Thu, Mar 31, 2011 at 12:52 PM, Rasmus Lerdorf wrote: > On 03/31/2011 08:45 AM, Philip Olson wrote: > > > - Intuitive name > > Argh! Everyone should be forced to learn a bit of C. Like many PHP > functions, the name and argument order is right out of libc. If you type > "man strstr" at your (non-Windows) prompt you get a nice little > description of what it does. > > -Rasmus > --20cf307d046c3ddbde049fcb0b8f--