php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54347 reflection_extension does not lowercase module function name
Submitted: 2011-03-22 13:36 UTC Modified: 2011-06-10 00:45 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: laruence at yahoo dot com dot cn Assigned: felipe (profile)
Status: Closed Package: Reflection related
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: laruence at yahoo dot com dot cn
New email:
PHP Version: OS:

 

 [2011-03-22 13:36 UTC] laruence at yahoo dot com dot cn
Description:
------------
in 
static void _extension_string(string *str, zend_module_entry *module, char *indent TSRMLS_DC)
in php_reflection.c

when reflect extension functions , the codes:
 
        while (func->fname) {
            if (zend_hash_find(EG(function_table), func->fname, strlen(func->fname) + 1, (void**) &fptr) == FAILURE) {
       
            }

when func->fname is not lowercase cause a PHP warning:

Warning: Internal error: Cannot find extension function qrcode_encodeString in global function table in Unknown on line 0

Test script:
---------------
no

Expected result:
----------------
no

Actual result:
--------------
no

Patches

lowcase-func-name-in-reflection-extension (last revision 2011-03-22 12:37 UTC by laruence at yahoo dot com dot cn)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-22 16:01 UTC] cataphract@php.net
This should still probably be fixed, but the functions should be declared with lowercase names. If you search for PHP_FE in lxr.php.net, you'll notice this is always the case.

In any case, since zend_register_functions does a lowercasing of the function names in the module list, the reflection ext should do it too. But for forward compatibility (in the future we may want to reduce the points where names are lowercased), it would be best if the extension follows the convention.
 [2011-05-25 14:13 UTC] neuhauser+bugs dot php dot net at sigpipe dot cz
i'm wrapping a third-party C library that exposes functions named with camel case.  i need to keep the function names.  this bug makes the implementation more verbose, and the names returned from ReflectionExtension are harder to read.

this bug (or limitation) should be pointed out in http://www.php.net/manual/en/internals2.funcs.php
 [2011-06-10 00:45 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=311990
Log: - Fixed bug #54347 (reflection_extension does not lowercase module function name)
  patch by: laruence at yahoo dot com dot cn
 [2011-06-10 00:45 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2011-06-10 00:45 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2011-06-11 17:11 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=312052
Log: - Missing fix for bug #54347
 [2012-04-18 09:50 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7c46410876dca6efe1b58c2ffad16114e24b67a3
Log: - Fixed bug #54347 (reflection_extension does not lowercase module function name)   patch by: laruence at yahoo dot com dot cn
 [2012-07-24 23:41 UTC] rasmus@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7c46410876dca6efe1b58c2ffad16114e24b67a3
Log: - Fixed bug #54347 (reflection_extension does not lowercase module function name)   patch by: laruence at yahoo dot com dot cn
 [2013-11-17 09:37 UTC] laruence@php.net
Automatic comment on behalf of felipe
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7c46410876dca6efe1b58c2ffad16114e24b67a3
Log: - Fixed bug #54347 (reflection_extension does not lowercase module function name)   patch by: laruence at yahoo dot com dot cn
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC