On Thu, Nov 22, 2001 at 09:52:31PM -0000, [EMAIL PROTECTED] wrote : > ID: 10172 > User updated by: [EMAIL PROTECTED] > Reported By: [EMAIL PROTECTED] > Old Status: Feedback > Status: Open > Bug Type: Documentation problem > Operating System: RH 7.0 > PHP Version: 4.0 Latest CVS (04/04/2001) > New Comment:
Well .. the documentation always documents the 'current' state as much as it can, so it is right to update the docs. However, I don't like the idea to lowercase all classes. I'ld rather see the original notation of classes not to be changed at all. No idea why there was every introduced lowercases .... 2c from Markus > > 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 > > Previous Comments: > ------------------------------------------------------------------------ > > [2001-11-22 16:04:07] [EMAIL PROTECTED] > > Seems strange. Docs have been updated to reflect current > behavior. Changing status to 'feedback'. > > > ------------------------------------------------------------------------ > > [2001-11-22 11:08:41] [EMAIL PROTECTED] > > Well, I suppose it is a documentation problem of sorts ... but my preference would >be for the get_class() function to be consistent, regardless of whether the class is >user-defined or extention-defined. > > Any reason why this shouldn't be consistent? > > - Colin > > ------------------------------------------------------------------------ > > [2001-11-21 19:35:55] [EMAIL PROTECTED] > > get_class() only returns user defined classes in lowercase. > > Classes defined in extensions are returned in their original notation. > > Making this a documentation problem. > > ------------------------------------------------------------------------ > > [2001-04-04 20:41:34] [EMAIL PROTECTED] > > 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 > > ------------------------------------------------------------------------ > > > > Edit this bug report at http://bugs.php.net/?id=10172&edit=1 > > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Markus Fischer, http://guru.josefine.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -All your scripts are belong to Zend-