case HASH_KEY_IS_STRING:
ZEND_PUTS(string_key);
break;
+ case HASH_KEY_IS_BINARY:
+ zend_printf("b\"%s\"", string_key);
+ break;
+ case HASH_KEY_IS_UNICODE:
+ zend_printf("%r", string_key);
+ break;
case HASH_KEY_IS_LONG:
zend_printf("%ld", num_key);
break;
ALLOC_ZVAL(value_ptr);
*value_ptr = **value;
INIT_PZVAL(value_ptr);
- zend_error(E_STRICT, "Implicit cloning object of class '%s' because of 'zend.ze1_compatibility_mode'", class_name);
+ zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name);
if(!dup) {
efree(class_name);
}
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC);
ZEND_API int zend_u_declare_property(zend_class_entry *ce, zend_uchar type, void *name, int name_length, zval *property, int access_type TSRMLS_DC);
+ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, void *name, int name_length, zval *property, int access_type, char *doc_comment, int doc_comment_len TSRMLS_DC);
ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC);
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *name, int name_length, zval *value TSRMLS_DC);
}
if (Z_TYPE_PP(klass) == IS_OBJECT) {
ce = Z_OBJCE_PP(klass);
- } else if (Z_TYPE_PP(klass) == IS_STRING) {
- if (zend_lookup_class(Z_STRVAL_PP(klass), Z_STRLEN_PP(klass), &pce TSRMLS_CC) == FAILURE) {
+ } else if (Z_TYPE_PP(klass) == IS_STRING || Z_TYPE_PP(klass) == IS_UNICODE) {
+ if (zend_u_lookup_class(Z_TYPE_PP(klass), Z_STRVAL_PP(klass), Z_STRLEN_PP(klass), &pce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
ce = *pce;
RETURN_FALSE;
}
- convert_to_string_ex(method_name);
+ if (Z_TYPE_PP(method_name) != IS_STRING || Z_TYPE_PP(method_name) == IS_UNICODE) {
+ convert_to_text_ex(method_name);
+ }
lcname = zend_u_str_case_fold(Z_TYPE_PP(method_name), Z_UNIVAL_PP(method_name), Z_UNILEN_PP(method_name), 1, &lcname_len);
if (zend_u_hash_exists(&ce->function_table, Z_TYPE_PP(method_name), lcname, lcname_len+1)) {
efree(lcname);
if (ZEND_NUM_ARGS()!= 2 || zend_get_parameters_ex(2, &object, &property)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
}
- convert_to_string_ex(property);
- if (!Z_STRLEN_PP(property)) {
+
+ if (Z_TYPE_PP(property) != IS_STRING && Z_TYPE_PP(property) != IS_UNICODE) {
+ convert_to_text_ex(property);
+ }
+
+ if (!Z_UNILEN_PP(property)) {
RETURN_FALSE;
}
switch((*object)->type) {
case IS_STRING:
- if (!Z_STRLEN_PP(object)) {
+ case IS_UNICODE:
+ if (!Z_UNILEN_PP(object)) {
RETURN_FALSE;
}
- if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_u_lookup_class(Z_TYPE_PP(object), Z_UNIVAL_PP(object), Z_UNILEN_PP(object), &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
} else {
RETURN_FALSE;
if (property_info->flags & ZEND_ACC_PUBLIC) {
RETURN_TRUE;
}
- zend_unmangle_property_name(property_info->name, &class_name, &prop_name);
- if (!strncmp(class_name, "*", 1)) {
+ zend_u_unmangle_property_name(Z_TYPE_PP(property), property_info->name, &class_name, &prop_name);
+ if (class_name[0] == '*') {
if (instanceof_function(EG(scope), ce TSRMLS_CC)) {
RETURN_TRUE;
}
RETURN_FALSE;
}
- if (zend_lookup_class(Z_STRVAL_PP(object), Z_STRLEN_PP(object), &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_u_lookup_class(Z_TYPE_PP(object), Z_UNIVAL_PP(object), Z_UNILEN_PP(object), &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
} else {
RETURN_FALSE; /* shouldn't happen */
zend_printf("#%-2d ", indent);
if (class_name) {
if (UG(unicode)) {
- zend_printf("%r(", class_name);
+ zend_printf("%r", class_name);
} else {
ZEND_PUTS(class_name);
}
CG(doc_comment_len) = 0;
}
- zend_u_declare_property(CG(active_class_entry), Z_TYPE(var_name->u.constant), Z_UNIVAL(var_name->u.constant), Z_UNILEN(var_name->u.constant), property, access_type TSRMLS_CC);
+ zend_u_declare_property_ex(CG(active_class_entry), Z_TYPE(var_name->u.constant), Z_UNIVAL(var_name->u.constant), Z_UNILEN(var_name->u.constant), property, access_type, comment, comment_len TSRMLS_CC);
efree(var_name->u.constant.value.str.val);
}
}
if (zend_u_hash_add(EG(zend_constants), type, name, lookup_name_len, (void *) c, sizeof(zend_constant), NULL)==FAILURE) {
- zend_error(E_NOTICE,"Constant %s already defined", name);
+ zend_error(E_NOTICE,"Constant %R already defined", type, name);
free(c->name);
if (!(c->flags & CONST_PERSISTENT)) {
zval_dtor(&c->value);
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, char *str_index, uint str_length, ulong num_index, HashPosition *pos)
{
Bucket *p;
+ uint real_length;
p = pos ? (*pos) : ht->pInternalPointer;
if (p) {
if (key_type == HASH_KEY_IS_LONG) {
- str_length = 0;
+ real_length = str_length = 0;
if (!p->nKeyLength && p->h == num_index) {
return SUCCESS;
}
zend_hash_index_del(ht, num_index);
} else if (key_type == HASH_KEY_IS_STRING || key_type == HASH_KEY_IS_BINARY) {
+ real_length = str_length;
if (p->nKeyLength == str_length &&
p->key.type == ((key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY) &&
memcmp(p->key.u.string, str_index, str_length) == 0) {
}
zend_u_hash_del(ht, (key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY, str_index, str_length);
} else if (key_type == HASH_KEY_IS_UNICODE) {
+ real_length = str_length * sizeof(UChar);
if (p->nKeyLength == str_length &&
p->key.type == IS_UNICODE &&
- memcmp(p->key.u.string, str_index, str_length * sizeof(UChar*)) == 0) {
+ memcmp(p->key.u.string, str_index, real_length) == 0) {
return SUCCESS;
}
zend_u_hash_del(ht, IS_UNICODE, str_index, str_length);
}
if (p->nKeyLength != str_length) {
- Bucket *q = (Bucket *) pemalloc(sizeof(Bucket) - 1 + str_length, ht->persistent);
+ Bucket *q = (Bucket *) pemalloc(sizeof(Bucket) - 1 + real_length, ht->persistent);
q->nKeyLength = str_length;
if (p->pData == &p->pDataPtr) {
if (key_type == HASH_KEY_IS_LONG) {
p->h = num_index;
} else if (key_type == HASH_KEY_IS_UNICODE) {
- memcpy(p->key.u.unicode, str_index, str_length * sizeof(UChar));
+ memcpy(p->key.u.unicode, str_index, real_length);
p->key.type = IS_UNICODE;
p->h = zend_u_inline_hash_func(IS_UNICODE, str_index, str_length);
} else {
- memcpy(p->key.u.string, str_index, str_length);
+ memcpy(p->key.u.string, str_index, real_length);
p->key.type = (key_type == HASH_KEY_IS_STRING)?IS_STRING:IS_BINARY;
p->h = zend_u_inline_hash_func(p->key.type, str_index, str_length);
}
if (!(property_info->flags & ZEND_ACC_PRIVATE)) {
/* we we're looking for a private prop but found a non private one of the same name */
return FAILURE;
- } else if (strcmp(prop_info_name+1, property_info->name+1)) {
+ } else if (!UG(unicode) && strcmp(prop_info_name+1, property_info->name+1)) {
+ /* we we're looking for a private prop but found a private one of the same name but another class */
+ return FAILURE;
+ } else if (UG(unicode) && u_strcmp(((UChar*)prop_info_name)+1, ((UChar*)property_info->name)+1)) {
/* we we're looking for a private prop but found a private one of the same name but another class */
return FAILURE;
}
TSRMLS_FETCH();
if (Z_OBJ_HANDLER_PP(p, clone_obj) == NULL) {
- zend_error(E_ERROR, "Trying to clone an uncloneable object of class %s", Z_OBJCE_PP(p)->name);
+ zend_error(E_ERROR, "Trying to clone an uncloneable object of class %v", Z_OBJCE_PP(p)->name);
} else {
zval *orig = *p;
retval = (zend_hash_num_elements(ht)?1:0);
}
} else {
- zend_error(E_NOTICE, "Object of class %s could not be converted to int", Z_OBJCE_P(op)->name);
+ zend_error(E_NOTICE, "Object of class %v could not be converted to int", Z_OBJCE_P(op)->name);
}
zval_dtor(op);
ZVAL_LONG(op, retval);