Bug #68194 [Fbk->NoF]: Closure captures late bound class too eagerly

From: Date: Sun, 17 May 2015 04:22:29 +0000
Subject: Bug #68194 [Fbk->NoF]: Closure captures late bound class too eagerly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192699@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68194&edit=1 ID: 68194 Updated by: php-bugs@lists.php.net Reported by: denis at slik dot eu Summary: Closure captures late bound class too eagerly -Status: Feedback +Status: No Feedback Type: Bug Package: Scripting Engine problem Operating System: Irrelevant PHP Version: 5.6.1 Assigned To: levim Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2015-05-07 06:40:52] denis at slik dot eu Is that a bug in the documentation, then? (The bit that you have quoted) In addition, is the difference of behavior between regular code and code in the same location in the closure intended? Finally, do you consider a backwards compatibility breakage? ------------------------------------------------------------------------ [2015-05-05 17:59:31] levim@php.net I have looked at this again and I believe that this is not a bug. Class Right has no permission to access anything that is protected or private in Left. ------------------------------------------------------------------------ [2014-10-17 14:45:14] levim@php.net This behavior is documented on the visibility page: http://php.net/manual/en/language.oop5.visibility.php > Members declared protected can be accessed only within the class itself and by inherited and > parent classes. With that being said, everyone I have talked to thus far believes it is a bug and should be considered for removal in the next major version of PHP. This needs to be discussed with more people. While that discussion is going on I'll dig into the technical details of why the closure doesn't work. ------------------------------------------------------------------------ [2014-10-17 13:58:36] levim@php.net To be completely honest, I am not sure why Right and Base can access a protected property in Left. The behavior of the closure actually seems correct to me. I'll have to poke around in documentation and talk to more people. Thank you for this report. ------------------------------------------------------------------------ [2014-10-17 13:18:43] tyrael@php.net Levi, could you look into this please? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=68194 -- Edit this bug report at https://bugs.php.net/bug.php?id=68194&edit=1

« previous php.bugs (#192699) next »