Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61374 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87620 invoked from network); 17 Jul 2012 19:01:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2012 19:01:39 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.143 smtp143.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.143] ([67.192.241.143:48953] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/66-54353-296B5005 for ; Tue, 17 Jul 2012 15:01:39 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp14.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id F315229821E; Tue, 17 Jul 2012 15:01:35 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp14.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 2C7C6298181; Tue, 17 Jul 2012 15:01:35 -0400 (EDT) Message-ID: <5005B68E.8080805@sugarcrm.com> Date: Tue, 17 Jul 2012 12:01:34 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Alexey Zakhlestin CC: Pierre Joye , Gustavo Lopes , internals , Andrew Faulds References: <50059AF8.5050805@sugarcrm.com> <9430CE0C-7DA4-4655-92D5-056E12A7BC74@gmail.com> <5005A5E4.2030004@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Options are: * "5-to-6" tool, similar to python's "2-to-3" converter, > which will fix code. Do you know any practical way of how such tool could work? > * introduce some kind of per-file declare() option, which would > enable pass-by-reference semantics of arrays/strings/etc. in 5.5 > which would let people write the same code for 5.5 and 6.x I don't think it's a viable option. The goal is to run existing code, if you'd need to change each file that defeats the purpose of it. > Well, actually, there's one more option: we can introduce > "Autocloned" interface (empty, without methods) and force "cloning" > of objects, which implement this interface, during parameter-fetching > phase. This would allow us to have 2 sets of classes: One set which It's not only parameter fetching. It's everywhere - assignment, access, etc. Example: $b = $a; $b[0] = 1; $a should not change in this situation, for arrays. For objects, $a and $b are the same. Different semantics. Introducing such semantics for classes would be a major complication in the engine, even if it's doable (which I doubt) I don't think it is a goo idea. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227