Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61408 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9620 invoked from network); 18 Jul 2012 15:27:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2012 15:27:39 -0000 Authentication-Results: pb1.pair.com header.from=amaury.bouchard@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=amaury.bouchard@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: amaury.bouchard@gmail.com X-Host-Fingerprint: 209.85.160.170 mail-gh0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:63289] helo=mail-gh0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/EE-39169-AE5D6005 for ; Wed, 18 Jul 2012 11:27:38 -0400 Received: by ghbg2 with SMTP id g2so1923237ghb.29 for ; Wed, 18 Jul 2012 08:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=sydt+IgpIKJUiL0epVai0rvw1illJaPN14ZW3qkS7Vc=; b=ZMmAxNtFtVZM+QYFEzyIm2hZkRrfcYcpA2tvH3Zw3E7scv62V8ZqLh2zpabpnV+k29 p3sAfM8KME5P9V8Y0SBcNU3EDRO1LULFZqNFneVge09oF0zQ+gIdsCEaIhi+dSVqn1mI iNSm8TXlmlddQBo65nrQ1MR3mD0VwsyXWzaDgK2ENVR1vfcMmdisbFlF03SAe2J3EMSj F/oDjLpy69TYPbiUnYYjyPtfRkDODvyyKM5BuvmV0N1tnIdbMNnCbPK7SHMyFRs4+HKd lOc9vuyb+Rn6J5qly/g2wCxGiYyODGmfWOttKkWhc7lR3kcxT4+tzYKegTxB3bXR59Lt Cv3Q== Received: by 10.60.12.37 with SMTP id v5mr1944115oeb.25.1342625255530; Wed, 18 Jul 2012 08:27:35 -0700 (PDT) MIME-Version: 1.0 Sender: amaury.bouchard@gmail.com Received: by 10.182.60.131 with HTTP; Wed, 18 Jul 2012 08:27:14 -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 17:27:14 +0200 X-Google-Sender-Auth: 1qo0wu1gkk7bbpO7A_DpODhXRng Message-ID: To: Andrew Faulds Cc: Pierre Joye , Stas Malyshev , internals Content-Type: multipart/alternative; boundary=e89a8f83a7356c224a04c51c4d1c Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: amaury@amaury.net (Amaury Bouchard) --e89a8f83a7356c224a04c51c4d1c Content-Type: text/plain; charset=ISO-8859-1 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 > > > > > --e89a8f83a7356c224a04c51c4d1c--