|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-04-04 20:41 UTC] colin at easydns dot com
get_class() is documented to return the class/object name in lowercase. This isn't the case for DomText, DomDocument, etc. objects. In these cases, get_class() returns the StudyCaps version of the object name. - Colin PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
I *really* don't think this should be a documentation fix, I think the get_class() function needs to be changed to always return lowercase. Here is the required patch: cmv@vincent:/usr/local/sources/php4/Zend$ diff -u zend_builtin_functions.c NEW.zend_builtin_functions.c --- zend_builtin_functions.c Thu Nov 22 16:49:26 2001 +++ NEW.zend_builtin_functions.c Thu Nov 22 16:51:30 2001 @@ -458,7 +458,8 @@ { zval **arg; zend_class_entry *ce; - + char *lcname; + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &arg)==FAILURE) { ZEND_WRONG_PARAM_COUNT(); } @@ -467,7 +468,10 @@ } ce = Z_OBJCE_PP(arg); - RETURN_STRINGL(ce->name, ce->name_length, 1); + lcname = estrndup(ce->name, ce->name_length); + zend_str_tolower(lcname, ce->name_length); + + RETURN_STRINGL(lcname, ce->name_length, 1); } /* }}} */ - Colin