Edit report at http://bugs.php.net/bug.php?id=53610&edit=1
ID: 53610 Comment by: sergey dot s dot betke at novgaro dot ru Reported by: sergey dot s dot betke at novgaro dot ru Summary: closure and static private class member Status: Open Type: Feature/Change Request Package: Class/Object related Operating System: Windows PHP Version: 5.3.4 Block user comment: N Private report: N New Comment: My article in Russian on this issue <a href="http://sergey-s-betke.blogs.novgaro.ru/lyambda-funkcii-zamykaniya-i-klassy-php">http://sergey-s-betke.blogs.novgaro.ru/lyambda-funkcii-zamykaniya-i-klassy-php</a>. Previous Comments: ------------------------------------------------------------------------ [2010-12-26 00:19:09] sergey dot s dot betke at novgaro dot ru Description: ------------ just one example: class test { private static $_domain; static member() { add_settings_section( self::$_namespace . '_location_options', __('Location of your opensearch.xml file', self::$_domain), function () { ?> <p><?php _e('You can select location of your opensearch.xml file and his url, or leave automatic detection.', self::$_domain); ?></p> <?php }, self::$_namespace . '_options_page' ); } } and, this sample - not working. I honestly do not understand, and therefore the PHP developers do not consider the closure, created by the code of methods of class, as a class method. But it is implicitly "import" $this. Test script: --------------- class test { private static $_domain; static test_member() { add_settings_section( // wordpress API self::$_namespace . '_location_options', __('Location of your opensearch.xml file', self::$_domain), function () { ?> <p><?php _e('You can select location of your opensearch.xml file and his url, or leave automatic detection.', self::$_domain); ?></p> <?php }, self::$_namespace . '_options_page' ); } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53610&edit=1
