Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35584 invoked from network); 26 Sep 2014 07:05:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2014 07:05:06 -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 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:40622] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/41-27411-E1015245 for ; Fri, 26 Sep 2014 03:05:03 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp4.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id D95E81800C4; Fri, 26 Sep 2014 03:04:59 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp4.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 59FED1800AD; Fri, 26 Sep 2014 03:04:57 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net [108.66.6.48]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.13); Fri, 26 Sep 2014 07:04:59 GMT Message-ID: <54251012.8090108@sugarcrm.com> Date: Fri, 26 Sep 2014 00:04:50 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: Nikita Popov CC: Dmitry Stogov , Leigh , PHP Internals References: <54248E27.1040206@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [VOTE] Fix list() behavior inconsistency From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Long story short, because FETCH_DIM_R now supports CONST and TMP_VAR > operands, we can always use it and FETCH_DIM_TMP_VAR can be dropped - > that's all that has to be done in order to always support strings and > objects in list(). (I've linked a patch for this previously, see > https://github.com/nikic/php-src/compare/stringOffsetsInList). Excellent, IMO this is the most logical way to proceed - and I'm not sure why one check for one flag is something worth worrying about. Is it really that slow to check for one flag? > If I understood it correctly, then Dmitry's alternative is to add > support for CV and VAR operands to FETCH_DIM_TMP_VAR and always use that > for list(). This avoids having to check the ZEND_FETCH_ADD_LOCK flag in > FETCH_DIM_R. However I don't think that this optimization is related to > whether or not we support strings and objects. We can have a separate > opcode only for list() in either case, no matter which choice is made here. We can, of course, but with your explanation I don't really see why we even should... -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/