Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61341 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15980 invoked from network); 17 Jul 2012 10:21:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2012 10:21:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:44544] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/63-28715-BAC35005 for ; Tue, 17 Jul 2012 06:21:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id C8B2F700044A; Tue, 17 Jul 2012 11:21:28 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id bNQLHrPQhVYX; Tue, 17 Jul 2012 11:21:28 +0100 (WEST) Received: from nebm.ist.utl.pt (unknown [IPv6:2001:690:2100:4::58:1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 7FA1E700043D; Tue, 17 Jul 2012 11:21:28 +0100 (WEST) Received: from localhost ([127.0.0.1] helo=nebm.ist.utl.pt) by nebm.ist.utl.pt with esmtp (Exim 4.72) (envelope-from ) id 1Sr4uG-00017p-FE; Tue, 17 Jul 2012 11:21:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 17 Jul 2012 12:21:28 +0200 To: Pierre Joye Cc: internals , Andrew Faulds Organization: =?UTF-8?Q?N=C3=BAcleo_de_Engenharia_Biom=C3=A9dica_do_Insti?= =?UTF-8?Q?tuto_Superior_T=C3=A9cnico?= In-Reply-To: References: Message-ID: <9df59951c29cafc8937404409fb9fe70@nebm.ist.utl.pt> X-Sender: glopes@nebm.ist.utl.pt User-Agent: RoundCube Webmail/0.5.3 Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: glopes@nebm.ist.utl.pt (Gustavo Lopes) On Tue, 17 Jul 2012 12:07:09 +0200, Pierre Joye wrote: > On Tue, Jul 17, 2012 at 2:12 AM, Gustavo Lopes > wrote: > >> 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 isn't a difference in terms of making PHP more object oriented, which was the main advantage advanced by the OP. I'm all for redesigning strings/arrays APIs (presented as an afterthought by the OP), but for that the discussion should be centered on what those APIs will look like, not the syntax one uses to call them. In fact, quite frequently, syntax discussions make more important design decisions be ignored (see namespaces). >> 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. -- Gustavo Lopes