ID: 48971 Updated by: j...@php.net Reported By: mike at mikegerwitz dot com Status: Closed Bug Type: Scripting Engine problem Operating System: GNU/Linux PHP Version: 5.3.0 New Comment:
Short version: ALWAYS use the ZEND_* macros. :) Previous Comments: ------------------------------------------------------------------------ [2009-07-28 21:14:14] j...@php.net Added the missing ZEND_NS_NAMED_FE macro. Adding the aliases for these _new_ macros is totally unnecessary. Having those for the old stuff was also unnecessary and very confusing to begin with, but that's another story.. ------------------------------------------------------------------------ [2009-07-28 21:12:42] s...@php.net Automatic comment from SVN on behalf of jani Revision: http://svn.php.net/viewvc/?view=revision&revision=286469 Log: - Fixed bug #48971 (Missing ZEND_NS_NAMED_FE macro) ------------------------------------------------------------------------ [2009-07-18 19:42:46] mike at mikegerwitz dot com Description: ------------ PHP 5.3 seems to have missed a few things internally (macro-wise) when it comes to namespaces. When developing an extension for 5.3, I noticed the following: Zend/zend_API.h:93 #define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) It's blank! I do not see any options to submit patches, therefore, this should be the definition: #define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) \ ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0) In addition, PHP_NS_* aliases are missing for the ZEND_NS_* macros. For example, PHP_FE is an alias to ZEND_FE. Therefore, the following macros should be added: #define PHP_NS_FE ZEND_NS_FE #define PHP_NS_NAMED_FE ZEND_NS_NAMED_FE #define PHP_NS_DEP_FE ZEND_NS_DEP_FE #define PHP_NS_FALIAS ZEND_NS_FALIAS #define PHP_NS_DEP_FALIAS ZEND_NS_DEP_FALIAS If you could provide me with a means to submit a patch, I would be more than happy to do it myself, as I feel this to be an important (albeit minor) addition for extension developers in order to keep things consistent, and less confusing. Reproduce code: --------------- zend_function_entry php_test_functions[] = { ZEND_NS_NAMED_FE( "Ns", myfunc, test_myfunc, NULL ) { NULL, NULL, NULL } }; --- <?php var_dump( get_extension_funcs('test') ); ?> Expected result: ---------------- array(1) { [0]=> string(16) "Ns\myfunc" } Actual result: -------------- array(0) { } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48971&edit=1