Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61339 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12338 invoked from network); 17 Jul 2012 10:07:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2012 10:07:13 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gh0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:43696] helo=mail-gh0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/A2-28715-F4935005 for ; Tue, 17 Jul 2012 06:07:13 -0400 Received: by ghbg2 with SMTP id g2so198020ghb.29 for ; Tue, 17 Jul 2012 03:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=59+CeNIdhvxSLp+uR5xO4m9ZAe3ekE6dS66G3wol4yM=; b=bc19bVQJ0RIdLkPePioFYPmlJxmXve3625xqPn+2AQstJ/EkqDVj77eHX0F9EYj9vn m39UcJ9pCirHNH5iL3UAGtrc0fdGYguDTdaWR5idpo596v5WPf9lV8SZ32avaBNvIjxp eH+l08ynMDYPwYfOVqZ1X30CKAIz0EQ/ga1GPOcS7oPI0qyDYVwgeUKS+wmLCDczuYnK Y0hzpj8jwMbNrI74d15R6t9iXNnd+udLpcdBOuvQbRSb8UbRDVWsYSqZkjztThISztvw 2jqPKqSGjp231m+2p2rAdkwNbktE9JsIfqnu4yTqc/I88A1SsoHpiviTFQ4sh4ESvkcu VC2A== MIME-Version: 1.0 Received: by 10.50.180.138 with SMTP id do10mr804874igc.36.1342519629408; Tue, 17 Jul 2012 03:07:09 -0700 (PDT) Received: by 10.231.205.211 with HTTP; Tue, 17 Jul 2012 03:07:09 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Jul 2012 12:07:09 +0200 Message-ID: To: Gustavo Lopes Cc: internals , Andrew Faulds Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: pierre.php@gmail.com (Pierre Joye) 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