#17658 [Ctl->Csd]: defines do not work properly
| From: | iliaa@php.net | Date: | Wed, 31 Jul 2002 13:11:09 +0000 |
| Subject: | #17658 [Ctl->Csd]: defines do not work properly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-15666@lists.php.net to get a copy of this message | ||
ID: 17658
Updated by: iliaa@php.net
Reported By: ilia@prohost.org
-Status: Critical
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: Linux 2.4.18
PHP Version: 4.0CVS-2002-06-08
Assigned To: hholzgra
New Comment:
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a
documentation
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.
Appears to work fine in 4.3.0
Previous Comments:
------------------------------------------------------------------------
[2002-06-17 09:05:59] hholzgra@php.net
i'm working on the locale dependencies issues
within the Zend engine, switching to non-locale
dependant implementations of tolower() and strtod()
------------------------------------------------------------------------
[2002-06-08 15:42:33] ilia@prohost.org
<?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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17658&edit=1