Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88745 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 219 invoked from network); 10 Oct 2015 23:16:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2015 23:16:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=bobwei9@hotmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bobwei9@hotmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.com designates 65.55.111.175 as permitted sender) X-PHP-List-Original-Sender: bobwei9@hotmail.com X-Host-Fingerprint: 65.55.111.175 blu004-omc4s36.hotmail.com Received: from [65.55.111.175] ([65.55.111.175:49399] helo=BLU004-OMC4S36.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/00-33317-03C99165 for ; Sat, 10 Oct 2015 19:16:01 -0400 Received: from BLU436-SMTP83 ([65.55.111.136]) by BLU004-OMC4S36.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sat, 10 Oct 2015 16:15:57 -0700 X-TMN: [bcDCWBjNiTz0WN3obX1p27QoL8ACNt8q] X-Originating-Email: [bobwei9@hotmail.com] Message-ID: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) In-Reply-To: Date: Sun, 11 Oct 2015 01:15:52 +0200 CC: Nikita Popov , PHP internals , Andrea Faulds , Stas Malyshev , Dmitry Stogov , Bob Weinand , Anatol Belski Content-Transfer-Encoding: quoted-printable References: To: Levi Morrison X-Mailer: Apple Mail (2.3094) X-OriginalArrivalTime: 10 Oct 2015 23:15:54.0992 (UTC) FILETIME=[9D148F00:01D103B1] Subject: Re: [PHP-DEV] Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure() From: bobwei9@hotmail.com (Bob Weinand) > Am 11.10.2015 um 00:16 schrieb Levi Morrison : >=20 >> Based on feedback received on an earlier version of this patch [6] = [7], we >> have not added any additional restrictions on rebinding of $this. >> getClosure()s of userland methods can still be bound to arbitrary = $this >> values and getClosure()s of internal methods can still be bound to >> "compatible" $this values. (If someone sees a problem with allowing = the >> former, please speak up!) >>=20 >> Note that all this applies to = ReflectionFunctionAbstract::getClosure() >> only. Rebinding behavior of ordinary closures doesn't change. >=20 > A user-defined closure can be rebound freely, but not one created from > Reflection - is that correct? Yes, correct. > My personal opinion is that we should be working to eliminate > differences between internal and user functions (including closures). > In your opinion can we make user and internal closures act more alike? > I'm assuming rebind internal methods can't be done properly because > internal objects may use different C structs than a plain zend_object > (hence the crashes). Is that correct? It's rather about the additional meta-data before the object which the = internal object requires. Hence you usually can use internal objects = like normal zend_object *'s, but not the inverse. The only way to make them actually more alike is putting more = restrictions (and BC breaks) than necessary onto the binding rules. = Loosening internal binding rules doesn't work as well... Bob=