Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88924 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76642 invoked from network); 23 Oct 2015 08:57:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2015 08:57:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-lf0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:34116] helo=mail-lf0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/D1-56439-286F9265 for ; Fri, 23 Oct 2015 04:57:40 -0400 Received: by lfaz124 with SMTP id z124so76085753lfa.1 for ; Fri, 23 Oct 2015 01:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=B7wl2q0b04LUriKxiTmV4psQ9A3ihjLyEzoqjVLPExc=; b=PazQTNo0MQ4O3BE5OYuXU5CVjSU2dvlKhP5W+TsgA/J2uU/gGjIPZ3CbA7n74Ub8Ds qGcKRc5p+/NqG/0N8C71URUG6MxkH9JQCZZA+smSZK1//cldy04tYDc/BJR7FIrP/GUy uc5gJ/rgNSNAzWZHF4Nd36jLlo7I+SXKVG+n171tK9LO1OylmoL0rGs2rfk4L5EShdmR LgZJRGlOPTirTQNyAV35YLmzjXifSRij65+jE9mHytVAP4plKUnAd3TSO6cT+Y6Zui64 7oi13kH3VWcfrS8ObFLhwHm4AvtvdwAahWlz7DDrdUlL4y0Rksqh9xDVvOKqdX4dzXPM /NyQ== MIME-Version: 1.0 X-Received: by 10.25.16.195 with SMTP id 64mr7084549lfq.62.1445590656141; Fri, 23 Oct 2015 01:57:36 -0700 (PDT) Received: by 10.25.152.133 with HTTP; Fri, 23 Oct 2015 01:57:35 -0700 (PDT) In-Reply-To: References: <01f001d1052b$bed5cbb0$3c816310$@belski.net> <022301d1053b$06a91a50$13fb4ef0$@belski.net> <02c801d10588$9009fd80$b01df880$@belski.net> Date: Fri, 23 Oct 2015 11:57:35 +0300 Message-ID: To: Julien Pauli Cc: Nikita Popov , Anatol Belski , Xinchen Hui , Dmitry Stogov , PHP internals Content-Type: multipart/alternative; boundary=001a113fb9848cd2290522c1cdaa Subject: Re: [PHP-DEV] Re: Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure() From: lisachenko.it@gmail.com (Alexander Lisachenko) --001a113fb9848cd2290522c1cdaa Content-Type: text/plain; charset=UTF-8 2015-10-22 18:48 GMT+03:00 Julien Pauli : > This is very tricky use case IMO. > > We should absolutely focus on stability, and if we can't find a way to > make things safe, we forbid them > for the stability sake. If there are no way to have stable things, > well, that's pitty but it's like that. > > We can't allow PHP to release with a known crashing behavior. > > Perhaps we'll find new ways to do things in 7.1 or next 8.0. > Good morning! Thank you, Julien, for paying an attention to my message and pointing to the things that are more important. I'm absolutely agree with you that the stability of the core is priority task for now, so it will be better to keep php7.0 core as stable as possible. Of course, this patch introduces some BC breaks, because now code that accepts \Closure instance should be able to check, if this instance of closure from ReflectionFunction or not to decide about possibility of binding. Technically they should be equal. Today I was able to test my code with RC5 and things aren't so bad, all main features working, except minor ones ) All dynamic methods can be called with closures, because I only need instance rebinding for closure, not the scope, because it's already passed as argument for getClosure($this). Simplified example https://3v4l.org/WRuZ6. For static methods, keeping LSB with closures is tricky, but it works via forward_static_call_array and putting it into the closure, which can be easily binded to the required scope: https://3v4l.org/kLN0E So, it's not a big deal for me anymore, all other things are tricky and aren't used very often. Thanks! --001a113fb9848cd2290522c1cdaa--