Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92027 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35660 invoked from network); 30 Mar 2016 16:18:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Mar 2016 16:18:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 157.56.111.143 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 157.56.111.143 mail-bn1bon0143.outbound.protection.outlook.com Received: from [157.56.111.143] ([157.56.111.143:64797] helo=na01-bn1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/01-28792-D5CFBF65 for ; Wed, 30 Mar 2016 11:18:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=euvqiYZMbtN3uBxA0SXSywwyZevswtiVToK8tiXhtSw=; b=M7SqHdrhm+PqJPYAOH2Ehvesu8lkKr0dBH+1KHuHr83tPQsSUWJiDjMLnXYlpae6jCPrnYG1TxRXdvqr4VZjvt2UA9yZf+x9pl8BzkVC3AdCzjQwFfop5nyrkvy7FOwmopdldou4SldXuu9JjQhCpkE5nQJZpeH6RFWytIhN3Sk= Received: from CY1PR0201MB1786.namprd02.prod.outlook.com (10.163.55.19) by CY1PR0201MB1785.namprd02.prod.outlook.com (10.163.55.18) with Microsoft SMTP Server (TLS) id 15.1.447.15; Wed, 30 Mar 2016 16:18:34 +0000 Received: from CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) by CY1PR0201MB1786.namprd02.prod.outlook.com ([10.163.55.19]) with mapi id 15.01.0447.024; Wed, 30 Mar 2016 16:18:34 +0000 To: Alexander Lisachenko , Nikita Popov CC: Antony Dovgal , PHP internals Thread-Topic: [PHP-DEV] Forbid binding methods to incompatible $this Thread-Index: AQHRigl+6xTV22juY0yTf1tMtTF7859xuSXtgAAZ/4CAABJXgIAACscc Date: Wed, 30 Mar 2016 16:18:33 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=zend.com; x-originating-ip: [132.245.81.165] x-ms-office365-filtering-correlation-id: c3c3577a-d91d-4619-9acb-08d358b6f10a x-microsoft-exchange-diagnostics: 1;CY1PR0201MB1785;5:AdNxFFaiCjqXE6AOItxnai09+hRODYyrgE+5tJ6qOPj6HjckKokFceNOOkwG3RqgMtDq1tQtQ36aL3U5jOWeexNMhWD7w10UjEWAkezdJgLwLmcQHGJbkCsWrapeNQ15WQmM3u2F4ssPyxCAJ7J1hw==;24:yuhMgR0TxR+mmEhZ72qo2zKy9wI/epCHBnmeK9pr0XxAoO4j/rEESJp8DNCbUzTIdAGoNdk0I8KkZOGi9IAmM+3Nmn3EkO7qKuyjpXX2dNs= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1785; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(102415293)(102615271)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:CY1PR0201MB1785;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1785; x-forefront-prvs: 08978A8F5C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(52314003)(377454003)(24454002)(377424004)(122556002)(19627595001)(19617315012)(17760045003)(16236675004)(19627405001)(81166005)(19625215002)(3900700001)(3660700001)(3280700002)(5008740100001)(2906002)(92566002)(5004730100002)(1096002)(189998001)(50986999)(1220700001)(99936001)(76176999)(6116002)(54356999)(99286002)(102836003)(586003)(3846002)(106116001)(11100500001)(33656002)(18206015028)(5003600100002)(93886004)(76576001)(87936001)(5001770100001)(19580395003)(77096005)(19580405001)(10400500002)(66066001)(5002640100001)(4326007)(86362001)(74316001)(2900100001)(2950100001)(15975445007)(7099028);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0201MB1785;H:CY1PR0201MB1786.namprd02.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: multipart/related; boundary="_004_CY1PR0201MB1786E629E54910939F6D4151BF980CY1PR0201MB1786_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2016 16:18:33.5980 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1785 Subject: Re: [PHP-DEV] Forbid binding methods to incompatible $this From: dmitry@zend.com (Dmitry Stogov) --_004_CY1PR0201MB1786E629E54910939F6D4151BF980CY1PR0201MB1786_ Content-Type: multipart/alternative; boundary="_000_CY1PR0201MB1786E629E54910939F6D4151BF980CY1PR0201MB1786_" --_000_CY1PR0201MB1786E629E54910939F6D4151BF980CY1PR0201MB1786_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Great it's not used anymore [😊] I personally agree to remove this. Nikita, can you also investigate the need for double pointer to object in typedef union _zend_function *(*zend_object_get_method_t)(zend_object **obj= ect, zend_string *method, const zval *key); As I remember, it's necessary only for some SPL hack, and looks like a terr= ible design decision. Thanks. Dmitry. ________________________________ From: Alexander Lisachenko Sent: Wednesday, March 30, 2016 15:07 To: Nikita Popov Cc: Dmitry Stogov; Antony Dovgal; PHP internals Subject: Re: [PHP-DEV] Forbid binding methods to incompatible $this Hello, internals! Go! AOP was used closure rebinding to an incompatible context only for one = minor specific feature, called privileged advices, where method was executi= ng in the context of target class. But all main closure binding in the fram= ework core work only with compatible contexts, so everything is ok with PHP= 7 now. So, this new patch is ok for me. Anyway, if I need this functionality again= , I can convert methods to the closures via AST transformation of classes. 2016-03-30 14:02 GMT+03:00 Nikita Popov >: On Wed, Mar 30, 2016 at 11:34 AM, Dmitry Stogov > wrote: > I agree, this ability is a dirty and annoying hack, but I'm sure, some > people use it. > > Tony, you don't use this in the new runkit replacement? :) > > Thanks. Dmitry. > Is this referring to https://github.com/badoo/soft-mocks? If so, searching the codebase for getClosure gives no results, so it shouldn't be affected. I know that the Go! AOP framework used to do some odd things with closure binding on methods. However their use case was *already* completely broken by the limitations we added in 7.0 and the feature was removed. Nikita --_000_CY1PR0201MB1786E629E54910939F6D4151BF980CY1PR0201MB1786_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Great it's not used anymore =3D"&#X1f60a"

I personally agree to remove this.


Nikita, can you also investigate the need for double pointer to object i= n


typedef union _zend_function *(*zend_object_get_method_t)(zend_object **= object, zend_string *method, const zval *key);


As I remember, it's necessary only for some SPL hack, and looks like a t= errible design decision.


Thanks. Dmitry.



From: Alexander Lisachenk= o <lisachenko.it@gmail.com>
Sent: Wednesday, March 30, 2016 15:07
To: Nikita Popov
Cc: Dmitry Stogov; Antony Dovgal; PHP internals
Subject: Re: [PHP-DEV] Forbid binding methods to incompatible $this<= /font>
 
Hello, internals!

Go! AOP was used closure rebinding to an incompatible context only for one = minor specific feature, called privileged advices, where method was executi= ng in the context of target class. But all main closure binding in the fram= ework core work only with compatible contexts, so everything is ok with PHP7 now.

So, this new patch is ok for me. Anyway, if I need this functionality again= , I can convert methods to the closures via AST transformation of classes.

2016-03-30 14:02 GMT+03:00 Nikita Popov <nikita.ppv@gm= ail.com>:
On Wed, Mar 30, 2016 at 11:34 AM, Dmitry Stogov <dmitry@zend.com> wrote:

> I agree, this ability is a dirty and annoying hack, but I'm sure, some=
> people use it.
>
> Tony, you don't use this in the new runkit replacement? :)
>
> Thanks. Dmitry.
>

Is this referring to https://github.com/badoo/soft-mocks? If so, searching
the codebase for getClosure gives no results, so it shouldn't be affected.<= br>
I know that the Go! AOP framework used to do some odd things with closure binding on methods. However their use case was *already* completely broken<= br> by the limitations we added in 7.0 and the feature was removed.

Nikita

--_000_CY1PR0201MB1786E629E54910939F6D4151BF980CY1PR0201MB1786_-- --_004_CY1PR0201MB1786E629E54910939F6D4151BF980CY1PR0201MB1786_--