On 29 September 2015 at 14:56, Peter Petermann <[email protected]> wrote: > why not just do "return function() { $this->myPrivateMethod(); };"
That would not work if there were any parameters to the function. Also all other information would need to be duplicated e.g. the return type. > this should be easy enough to do userland, including checking if the method > exists It depends what you consider 'easy'. Here is an implementation https://gist.github.com/Danack/27254e80b56bf477fd1f As I said in the RFC, it does a significant chunk of work in userland, including an exciting use of debug_backtrace to get the calling scope. I am not sure it is actually a complete implemenation. I got tired of writing it, and decided that it would be better implemented in PHP core. cheers Dan -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
