|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-17 09:05 UTC] hholzgra@php.net
[2002-07-31 09:11 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 18:00:01 2025 UTC |
<?php define('TEST', 'test#1'); define('test', 'test#2'); echo TEST."\n"; echo test."\n"; ?> Returns test#1 test The problem is the fault of zend_constants, which ALWAYS lowercases the define names when they are being stores/retrieved in/from the hash table. The same lowercasing code also causes i18n problems, with defines which do not support the characters in defines made prior to setlocale() function being called. Ref Bug #16865. The patch below fixes both problems --- zend_constants.c_old Sat Jun 8 15:58:01 2002 +++ zend_constants.c Sat Jun 8 15:58:09 2002 @@ -226,8 +226,6 @@ lookup_name = do_alloca(name_len+1); memcpy(lookup_name, name, name_len+1); - zend_str_tolower(lookup_name, name_len); - if (zend_hash_find(EG(zend_constants), lookup_name, name_len+1, (void **) &c)==SUCCESS) { if ((c->flags & CONST_CS) && memcmp(c->name, name, name_len)!=0) { retval=0; @@ -255,7 +253,6 @@ printf("Registering constant for module %d\n", c->module_number); #endif - zend_str_tolower(lowercase_name, c->name_len); if (zend_hash_add(EG(zend_constants), lowercase_name, c->name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) { free(c->name); if (!(c->flags & CONST_PERSISTENT)