Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61340 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14436 invoked from network); 17 Jul 2012 10:15:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2012 10:15:58 -0000 Authentication-Results: pb1.pair.com header.from=ajfweb@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajfweb@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:36926] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 15/13-28715-D5B35005 for ; Tue, 17 Jul 2012 06:15:57 -0400 Received: by wibhn17 with SMTP id hn17so3028042wib.11 for ; Tue, 17 Jul 2012 03:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/Ts6/A6ZuxZ7iUzqWyPHxoiz3eub8EUJLZEXhhBvv6I=; b=PvnL58nlU8m7XZmzGsHTvRjOazogqizTdsJoJlz/FfVKnWPcvb5Gx9A3lFm+ztKe8s cKCoYMzG3Z+MYozwNCfDd/jLu0nOYMSz0wfw3J4ct14BRELMz8mzIwBlAdi/yQiTy2sX zRNET3O0vPhrBxv7NYnyydK8h0ZrW9JcVC1LsYaajku/8M9qRLnUX/m+FgGap/prNAnR SMcRRJw4wggnj/B2FE241yD7Y30WhCVQXRlknZqGO086RjSmZkThC5ClhI3h054sKp++ W5T+a43HPdH/pfjixI08GS0zhyBghlExc4j8BGKjHSfGoFy55FuRkzE8ZJm98kKZv4bF vcdQ== MIME-Version: 1.0 Received: by 10.180.91.228 with SMTP id ch4mr2963298wib.7.1342520152433; Tue, 17 Jul 2012 03:15:52 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Tue, 17 Jul 2012 03:15:52 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Tue, 17 Jul 2012 03:15:52 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Jul 2012 11:15:52 +0100 Message-ID: To: Pierre Joye Cc: internals , Gustavo Lopes Content-Type: multipart/alternative; boundary=f46d043c7fa2ca234604c503d4f3 Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: ajfweb@googlemail.com (Andrew Faulds) --f46d043c7fa2ca234604c503d4f3 Content-Type: text/plain; charset=UTF-8 I think strings are even more important, they have an even messier API than arrays. On Jul 17, 2012 11:07 AM, "Pierre Joye" wrote: > hi, > > On Tue, Jul 17, 2012 at 2:12 AM, Gustavo Lopes > wrote: > > > Let's ignore empty arguments like "make[s] PHP feel modern". That aside, > the > > main argument advanced in this message makes no sense. > > This idea has been proposed many times in the past and it is actually > a very good proposal, for array, string or other types. > > The only reason why it is not yet implemented is the technical > complexity to do it. We need pseudo objects and the likes, and it is > really not something easy to do, in an efficient enough way. > > > Adding method call > > syntax to arrays hardly makes PHP more object oriented. Syntax is > > unimportant. There's no substantial difference between array_slice($arr, > > ...) and $arr->slice(...). > > There is a huge difference. One of the main difference would be to > finally have an uniform API and not this painful inconsistent APIs we > have to maintain. > > > There is, in my opinion, *one* merit here -- redesigning -- and perhaps > > reimplementing -- the arrays functions API. This will require a lot of > work, > > thought, and time tough. > > Yes, but long due, same for strings. > > Cheers, > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > --f46d043c7fa2ca234604c503d4f3--