Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88743 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95217 invoked from network); 10 Oct 2015 22:16:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2015 22:16:37 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.43 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.213.43 mail-vk0-f43.google.com Received: from [209.85.213.43] ([209.85.213.43:36336] helo=mail-vk0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/26-44453-24E89165 for ; Sat, 10 Oct 2015 18:16:35 -0400 Received: by vkgc187 with SMTP id c187so6075159vkg.3 for ; Sat, 10 Oct 2015 15:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=dPGJ2yKtg760dpE/oALF1VxY1RWtrGXPY/mxe7vsRNs=; b=J8erkOnhFPimP9csKHJWPONnBafVv4AnjswR3jCgnRMZG6PSXdrePvHzi6Wnra96iY 7+aXggtYrhL0Mf5lCl5UImX2WpNwqEQBmfXsuCAmyIbPX+lhszbER5unvs5oJcIvajCX wvtagPVXlNWq/9JDC6432CFI185ZPP2gvsTriRdCrgbwluyAI78uLso31061vzE1M/EQ wh9LqTaLJppGjyFUNzJt7h27IqCVpu8o/VAXMpU0/FfkJVInbgE6eN1fCoLK0W7wjTrN DeW50FMUfNyrYTH6fGHxKqIpYpcSRhfKpupWhvlc/4M048LdNQCs1+J+ulXoGObROh9d Bpew== MIME-Version: 1.0 X-Received: by 10.31.54.134 with SMTP id d128mr12197909vka.154.1444515391332; Sat, 10 Oct 2015 15:16:31 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.31.41.205 with HTTP; Sat, 10 Oct 2015 15:16:31 -0700 (PDT) In-Reply-To: References: Date: Sat, 10 Oct 2015 16:16:31 -0600 X-Google-Sender-Auth: VCrtzrYkQnHFLRbgDRuwTILj8hE Message-ID: To: Nikita Popov Cc: PHP internals , Andrea Faulds , Stas Malyshev , Dmitry Stogov , Bob Weinand , Anatol Belski Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Forbid rebinding scope of closures created by ReflectionFunctionAbstract::getClosure() From: levim@php.net (Levi Morrison) > 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!) > > Note that all this applies to ReflectionFunctionAbstract::getClosure() > only. Rebinding behavior of ordinary closures doesn't change. A user-defined closure can be rebound freely, but not one created from Reflection - is that 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?