Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61409 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11141 invoked from network); 18 Jul 2012 15:34:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2012 15:34:53 -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 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: ajfweb@googlemail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:45407] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F0/4F-39169-C97D6005 for ; Wed, 18 Jul 2012 11:34:53 -0400 Received: by weyr1 with SMTP id r1so1209219wey.29 for ; Wed, 18 Jul 2012 08:34:50 -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=19Qg3hR/dvrq8GHcO5viyhPxvmSNfaSxvwa4HMo3iQ8=; b=xaXUEb7m5Uq201/2VHRGtrpiHV9bZnimxMBrJex/uKN+4ueeX5q1pKYWGjyuygvNue B9snZ78SukaT0ua4gn5RrT9ZH7/2hWuNAPRsNJ9P4jLopgOYUMN/DzOt7mP5eyRjLkVA DSTYRO5wBYkeA5hJZDuMWWAEggMlkICF0dYcQpD/8yaW/ueJQEQPjR86NAcoLY6tvcjq Kcd8sJJcBAK6w9FEGVA2j1c3LiXsY3QbmR0AXLJIBCmc3uYJJhPJ4EH2lCoL9LDiZTdN oYl9n80XLC3LTfweowvRvRL3IM4IizWMZGShBq1N426LXI6HKSCz73kWQ5L0W9J1VZQ1 J4fw== MIME-Version: 1.0 Received: by 10.180.100.35 with SMTP id ev3mr7734372wib.10.1342625688485; Wed, 18 Jul 2012 08:34:48 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Wed, 18 Jul 2012 08:34:48 -0700 (PDT) Received: by 10.216.160.16 with HTTP; Wed, 18 Jul 2012 08:34:48 -0700 (PDT) In-Reply-To: References: <50059AF8.5050805@sugarcrm.com> <5005CB58.2020601@sugarcrm.com> <50066724.6050901@sugarcrm.com> <50067040.3090307@sugarcrm.com> Date: Wed, 18 Jul 2012 16:34:48 +0100 Message-ID: To: Amaury Bouchard Cc: Pierre Joye , Stas Malyshev , internals Content-Type: multipart/alternative; boundary=f46d044282a63a80b604c51c67c2 Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: ajfweb@googlemail.com (Andrew Faulds) --f46d044282a63a80b604c51c67c2 Content-Type: text/plain; charset=UTF-8 It would probably be passed as first param to functions, or passed as $this, like other methods. On Jul 18, 2012 4:27 PM, "Amaury Bouchard" wrote: > Seems a lot like another syntactic sugar. > > Like in Lua, where you can write > obj:method(12) > instead of > obj.method(obj, 12) > > But OOP-like syntax on non-object data is still weird. The question about > data manipulation behavior (is it a pointer like other objects or is it a > scalar like existing array?) is a tough one. > > > 2012/7/18 Andrew Faulds > >> OK, ok. Let me clear some things up here. >> >> We don't want it to make things more object-oriented or whatever. The real >> motivation is to give us a chance to make a much cleaner, much nicer array >> API without breaking BC. We can keep the legacy array_* and unprefixed >> functions, but we can also create "pseudo-object methods" (not objects, >> but >> methods and possibly properties hooked into the method call processing, >> checking for non-object types - it's very easy to check (I've done it) for >> non-objects, and implementing this seems simple enough but I don't know >> the >> Zend engine well enough). This way we can have array->key, >> array->sort(TYPE), etc. for new code to use, instead of the legacy array >> and string method mess (the latter needs a cleanup more in particular). >> >> OK? >> On Jul 18, 2012 10:14 AM, "Pierre Joye" wrote: >> >> > hi, >> > >> > On Wed, Jul 18, 2012 at 10:13 AM, Stas Malyshev > > >> > wrote: >> > >> > > And no, it does not "allow us to clean our APIs" - I again point out >> > > using -> has nothing to do with cleaning APIs. Repeating "clean APIs" >> > > as if it is some magic spell will not make false statement true, and >> the >> > > statement that using -> somehow cleans up APIs is false. Cleaning APIs >> > > and pseudo-objects are two completely different things, and nobody yet >> > > shown any relationship between the two. >> > >> > You do not see it, your call. But it indeed does and anyone I was >> > talking to about this topic agrees with this view but two persons (you >> > incl.). >> > >> > Anyway, it is somehow pointless to argue to death about that as it is >> > technically not possible yet. I'm 200% sure it will happen. >> > >> > Cheers, >> > -- >> > Pierre >> > >> > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org >> > >> > -- >> > PHP Internals - PHP Runtime Development Mailing List >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> > >> > > --f46d044282a63a80b604c51c67c2--