--- /dev/null
+--TEST--
+Persistent case insensetive and user defined constants
+--FILE--
+<?php
+var_dump(ZEND_THREAD_safe);
+define("ZEND_THREAD_safe", 123);
+var_dump(ZEND_THREAD_safe);
+?>
+--EXPECTF--
+bool(%s)
+int(123)
zstr lookup_name = zend_u_str_case_fold(Z_TYPE_P(const_name), Z_UNIVAL_P(const_name), Z_UNILEN_P(const_name), 1, &lookup_name_len);
if (zend_u_hash_find(EG(zend_constants), Z_TYPE_P(const_name), lookup_name, lookup_name_len+1, (void **) &c)==SUCCESS) {
- if ((c->flags & CONST_CS) && memcmp(c->name.v, Z_UNIVAL_P(const_name).v, UG(unicode)?UBYTES(Z_USTRLEN_P(const_name)):Z_STRLEN_P(const_name))!=0) {
+ if ((c->flags & CONST_CT_SUBST) && !(c->flags & CONST_CS)) {
efree(lookup_name.v);
- return NULL;
+ return c;
}
- } else {
- efree(lookup_name.v);
- return NULL;
}
efree(lookup_name.v);
+ return NULL;
}
if (c->flags & CONST_CT_SUBST) {
return c;
lookup_name = zend_u_str_case_fold(type, name, name_len, 1, &lookup_name_len);
if (zend_u_hash_find(EG(zend_constants), type, lookup_name, lookup_name_len+1, (void **) &c)==SUCCESS) {
- if ((c->flags & CONST_CS) && memcmp(c->name.v, name.v, UG(unicode)?UBYTES(name_len):name_len)!=0) {
+ if (c->flags & CONST_CS) {
retval=0;
}
} else {