Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27457 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32606 invoked by uid 1010); 15 Jan 2007 17:44:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32591 invoked from network); 15 Jan 2007 17:44:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2007 17:44:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=andrei@gravitonic.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=andrei@gravitonic.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain gravitonic.com from 204.11.219.139 cause and error) X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from [204.11.219.139] ([204.11.219.139:54323] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/64-33655-A8DBBA54 for ; Mon, 15 Jan 2007 12:44:43 -0500 Received: from [192.168.11.2] (c-24-6-96-18.hsd1.ca.comcast.net [24.6.96.18]) (authenticated bits=0) by lerdorf.com (8.13.8/8.13.8/Debian-3) with ESMTP id l0FHidh1003324; Mon, 15 Jan 2007 09:44:40 -0800 In-Reply-To: <45AB0207.5080505@php.net> References: <45AB0207.5080505@php.net> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <429E7FAF-6D1C-4BE7-87C2-22D6404FBE05@gravitonic.com> Cc: internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Mon, 15 Jan 2007 09:44:38 -0800 To: Sara Golemon X-Mailer: Apple Mail (2.752.2) Subject: Re: [PHP-DEV] Runtime JIT Proposals From: andrei@gravitonic.com (Andrei Zmievski) I like Option 4. -Andrei On Jan 14, 2007, at 8:24 PM, Sara Golemon wrote: > Option 4: > Include fetchtype and subelement during runtime JIT callback > allowing JIT callback to only do work necessary to prepare for the > read/write call being performed. > > e.g. > > int php_example_jit_callback(int str_type, zstr str, int str_len, > int stage, zval *container, int fetch_type, zval *element); > > Where str_type/str/str_len indicate the name of the variable being > JITed, stage is one of COMPILETIME or RUNTIME, container is the > autoglobal itself. > Fetch_type is ZEND_FETCH_(DIM_|OBJ_)?_(R|W|RW), and element is the > specific property/offset (only applicable for DIM/OBJ fetches, NULL > for plain fetch. > > Advantages: Gives maximum flexibility to the implementation. In > the case of http request encoding, it allows the decoder to > differentiate between requests for a single element and fetches > which want to retreive the entire array (e.g. foreach). > > Disadvantages: Adds a lot of complexity to the fetching of > autoglobals and qand effectively doubles the amount of callback > work being done for autoglobal objects. Will also confuse > implementers on what the difference between this fetch callback is > and the (read|write)_(dimension|property) callbacks used by objects. > > > In response to the suggestion to just turn $_REQUEST (et.al.) into > objects with overloaded array access, the big danger there is that > the following behavior would change: > > $postdata = $_REQUEST; > foreach($postdata as $idx => $val) { > $postdata[$idx] = some_filter_func($val); > } > > Were $_REQUEST turned into an object with overloaded array access, > these changes to $postdata would modify the values in the original > $_REQUEST (due to the reference-like behavior of PHP5+ objects). > > > Personally, I like Option 4, but then I like complexity. I can > certainly see going for any of the others, but I want to go with > something that the rest of the group can see being appropriately > useful. > > If I can get something approaching a semi-consensus on direction, I > can have an implementation (or a couple, depending on feelings on > the matter) in a few days. > > -Sara > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php