Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61376 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90977 invoked from network); 17 Jul 2012 19:20:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2012 19:20:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; 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:59912] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/17-54353-C0BB5005 for ; Tue, 17 Jul 2012 15:20:45 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp14.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 743E2298A75; Tue, 17 Jul 2012 15:20:42 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp14.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 27E3A2987FA; Tue, 17 Jul 2012 15:20:39 -0400 (EDT) Message-ID: <5005BB06.6020909@sugarcrm.com> Date: Tue, 17 Jul 2012 12:20:38 -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> <5005B68E.8080805@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Pseudo-objects (methods on arrays, strings, etc.) From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > That would be: tokenizer + static analysis (with type inference) + replacing some of the tokens. > Not a trivial task, but definitely doable. So what would this tool do with this code? $a = getFirstArrayName(); $b = getSecondArrayName(); $$a = $$b; $b[1] = 0; Or this: include 'a.inc'; $a = $b; include 'b.inc'; where a.inc has array $a and b.inc has something like $b[1] = 0; but you have no way of knowing it since by the time you run the tool a.inc and b.inc are not available to it (think config files). -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227