From:             mike at mikegerwitz dot com
Operating system: GNU/Linux
PHP version:      5.3.0
PHP Bug Type:     *General Issues
Bug description:  ZEND_NS_* Macros

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 bug report at http://bugs.php.net/?id=48971&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=48971&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=48971&r=trysnapshot53
Try a snapshot (PHP 6.0):            
http://bugs.php.net/fix.php?id=48971&r=trysnapshot60
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=48971&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=48971&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48971&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48971&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48971&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48971&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48971&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48971&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48971&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48971&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48971&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48971&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48971&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48971&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48971&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48971&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48971&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48971&r=mysqlcfg

Reply via email to