if (class_name.s[0]=='*') {
ZEND_PUTS_EX(":protected");
} else {
+ UConverter *conv = ZEND_U_CONVERTER(UG(output_encoding_conv));
+ UErrorCode status = U_ZERO_ERROR;
+ char *s = NULL;
+ int s_len;
+
ZEND_PUTS_EX(":");
- if (UG(unicode)) {
- UConverter *conv = ZEND_U_CONVERTER(UG(output_encoding_conv));
- UErrorCode status = U_ZERO_ERROR;
- char *s = NULL;
- int s_len;
-
- zend_unicode_to_string_ex(conv, &s, &s_len, class_name.u, u_strlen(class_name.u), &status);
- if (U_FAILURE(status)) {
- zend_error(E_WARNING, "Could not convert Unicode to printable form");
- return;
- }
- ZEND_WRITE_EX(s, s_len);
- efree(s);
- } else {
- ZEND_PUTS_EX(class_name.s);
+ zend_unicode_to_string_ex(conv, &s, &s_len, class_name.u, u_strlen(class_name.u), &status);
+ if (U_FAILURE(status)) {
+ zend_error(E_WARNING, "Could not convert Unicode to printable form");
+ return;
}
+ ZEND_WRITE_EX(s, s_len);
+ efree(s);
ZEND_PUTS_EX(":private");
}
}
default:
*expr_copy = *expr;
zval_copy_ctor(expr_copy);
- if (UG(unicode)) {
- convert_to_string_with_converter(expr_copy, ZEND_U_CONVERTER(UG(output_encoding_conv)));
- } else {
- convert_to_string(expr_copy);
- }
+ convert_to_string_with_converter(expr_copy, ZEND_U_CONVERTER(UG(output_encoding_conv)));
break;
}
Z_TYPE_P(expr_copy) = IS_STRING;
Z_OBJ_HANDLER_P(expr, get_class_name)(expr, &class_name, &clen, 0 TSRMLS_CC);
}
if (class_name.v) {
- if (UG(unicode)) {
- UConverter *conv = ZEND_U_CONVERTER(UG(output_encoding_conv));
- UErrorCode status = U_ZERO_ERROR;
- char *s = NULL;
- int s_len;
-
- zend_unicode_to_string_ex(conv, &s, &s_len, class_name.u, clen, &status);
- if (U_FAILURE(status)) {
- zend_error(E_WARNING, "Could not convert Unicode to printable form");
- return;
- }
- ZEND_WRITE_EX(s, s_len);
- efree(s);
- } else {
- ZEND_PUTS_EX(class_name.s);
+ UConverter *conv = ZEND_U_CONVERTER(UG(output_encoding_conv));
+ UErrorCode status = U_ZERO_ERROR;
+ char *s = NULL;
+ int s_len;
+
+ zend_unicode_to_string_ex(conv, &s, &s_len, class_name.u, clen, &status);
+ if (U_FAILURE(status)) {
+ zend_error(E_WARNING, "Could not convert Unicode to printable form");
+ return;
}
+ ZEND_WRITE_EX(s, s_len);
+ efree(s);
} else {
ZEND_PUTS_EX("Unknown Class");
}
CG(asp_tags) = asp_tags_default;
CG(short_tags) = short_tags_default;
CG(compiler_options) = compiler_options_default;
- CG(literal_type) = ZEND_STR_TYPE;
+ CG(literal_type) = IS_UNICODE;
}
/* }}} */
static void function_to_unicode(zend_function *func TSRMLS_DC) /* {{{ */
{
if (func->common.function_name.s) {
- if (UG(unicode)) {
- func->common.function_name.u = zend_ustrdup(func->common.function_name.u);
- } else {
- UChar *uname;
- int len = strlen(func->common.function_name.s) + 1;
-
- uname = malloc(UBYTES(len));
- u_charsToUChars(func->common.function_name.s, uname, len);
- func->common.function_name.u = uname;
- }
+ func->common.function_name.u = zend_ustrdup(func->common.function_name.u);
}
if (func->common.arg_info) {
zend_arg_info *args;
zend_set_default_compile_time_values(TSRMLS_C);
CG(interactive) = 0;
- CG(literal_type) = ZEND_STR_TYPE;
+ CG(literal_type) = IS_UNICODE;
compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable));
zend_u_hash_init_ex(compiler_globals->auto_globals, global_auto_globals_table->nNumOfElements, NULL, NULL, 1, UG(unicode), 0);
void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */
{
int module_number = 0;
-
+ UConverter *old_runtime_encoding_conv;
+ UErrorCode status = U_ZERO_ERROR;
+
REGISTER_INI_ENTRIES();
/* Make copies of HashTables with UNICODE */
+ old_runtime_encoding_conv = UG(runtime_encoding_conv);
+ UG(runtime_encoding_conv) = ucnv_open("ASCII", &status);
- if (UG(unicode)) {
- UConverter *old_runtime_encoding_conv;
- UErrorCode status = U_ZERO_ERROR;
-
- old_runtime_encoding_conv = UG(runtime_encoding_conv);
- UG(runtime_encoding_conv) = ucnv_open("ASCII", &status);
+ zend_hash_to_unicode(CG(function_table), (apply_func_t)function_to_unicode TSRMLS_CC);
+ CG(function_table)->pDestructor = ZEND_U_FUNCTION_DTOR;
+ zend_hash_to_unicode(CG(class_table), (apply_func_t)class_to_unicode TSRMLS_CC);
+ zend_hash_to_unicode(CG(auto_globals), NULL TSRMLS_CC);
+ zend_hash_to_unicode(EG(zend_constants), (apply_func_t)const_to_unicode TSRMLS_CC);
+ EG(zend_constants)->pDestructor = ZEND_U_CONSTANT_DTOR;
- zend_hash_to_unicode(CG(function_table), (apply_func_t)function_to_unicode TSRMLS_CC);
- CG(function_table)->pDestructor = ZEND_U_FUNCTION_DTOR;
- zend_hash_to_unicode(CG(class_table), (apply_func_t)class_to_unicode TSRMLS_CC);
- zend_hash_to_unicode(CG(auto_globals), NULL TSRMLS_CC);
- zend_hash_to_unicode(EG(zend_constants), (apply_func_t)const_to_unicode TSRMLS_CC);
- EG(zend_constants)->pDestructor = ZEND_U_CONSTANT_DTOR;
+ ucnv_close(UG(runtime_encoding_conv));
+ UG(runtime_encoding_conv) = old_runtime_encoding_conv;
- ucnv_close(UG(runtime_encoding_conv));
- UG(runtime_encoding_conv) = old_runtime_encoding_conv;
- }
zend_startup_builtin_functions(TSRMLS_C);
}
/* }}} */
va_copy(usr_copy, args);
Z_STRLEN_P(z_error_message) = zend_vspprintf(&Z_STRVAL_P(z_error_message), 0, format, usr_copy);
Z_TYPE_P(z_error_message) = IS_STRING;
- if (UG(unicode)) {
+ {
char *str = Z_STRVAL_P(z_error_message);
int len = Z_STRLEN_P(z_error_message);
#define OE_IS_METHOD (1<<2)
/* default engine string type */
-#define ZEND_STR_TYPE (UG(unicode) ? IS_UNICODE : IS_STRING)
+#define ZEND_STR_TYPE IS_UNICODE
int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC);
void zend_shutdown(TSRMLS_D);
return "double";
case IS_STRING:
{
- TSRMLS_FETCH();
-
- if (UG(unicode)) {
- return "binary string";
- } else {
- return "string";
- }
+ return "binary string";
}
case IS_OBJECT:
return "object";
}
if (c == 'x') {
- c = UG(unicode) ? 'u' : 's';
+ c = 'u';
}
switch (c) {
case IS_ARRAY:
case IS_RESOURCE:
default:
- if (UG(unicode)) {
- return "binary string";
- } else {
- return "string";
- }
+ return "binary string";
}
}
break;
if (return_null) {
*p = NULL_ZSTR;
*pl = 0;
- *type = UG(unicode)?IS_UNICODE:IS_STRING;
+ *type = IS_UNICODE;
break;
}
/* break omitted intentionally */
case IS_LONG:
case IS_DOUBLE:
case IS_BOOL:
- if (UG(unicode)) {
- convert_to_unicode_ex(arg);
- RETURN_AS_UNICODE(arg, p, pl, type);
- } else {
- convert_to_string_ex(arg);
- RETURN_AS_STRING(arg, p, pl, type);
- }
+ convert_to_unicode_ex(arg);
+ RETURN_AS_UNICODE(arg, p, pl, type);
break;
case IS_STRING:
break;
case IS_OBJECT:
- if (parse_arg_object_to_string(arg, (char**)p, pl, UG(unicode) ? IS_UNICODE : IS_STRING TSRMLS_CC) == SUCCESS) {
- *type = UG(unicode)?IS_UNICODE:IS_STRING;
+ if (parse_arg_object_to_string(arg, (char**)p, pl, IS_UNICODE TSRMLS_CC) == SUCCESS) {
+ *type = IS_UNICODE;
break;
}
*p = *arg;
} else {
if (ce) {
- *ret_type = UG(unicode)?IS_UNICODE:IS_STRING;
+ *ret_type = IS_UNICODE;
return ce->name.v;
} else {
return "object";
*pce = NULL;
break;
}
- convert_to_text_ex(arg);
+ convert_to_unicode_ex(arg);
if (zend_u_lookup_class(Z_TYPE_PP(arg), Z_UNIVAL_PP(arg), Z_UNILEN_PP(arg), &lookup TSRMLS_CC) == FAILURE) {
*pce = NULL;
} else {
}
if (T_arg_type == -1) {
- T_arg_type = ZEND_STR_TYPE;
+ T_arg_type = IS_UNICODE;
}
}
unsigned int lcname_len;
zstr lcname;
int name_len;
- zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar utype = IS_UNICODE;
/* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
- if (UG(unicode)) {
- name_len = u_strlen(fptr->common.function_name.u);
- } else {
- name_len = strlen(fptr->common.function_name.s);
- }
+ name_len = u_strlen(fptr->common.function_name.u);
lcname = zend_u_str_case_fold(utype, fptr->common.function_name, name_len, 0, &lcname_len);
if (lcname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 &&
if (scope) {
lc_class_name_len = scope->name_length;
- if (UG(unicode)) {
- if ((lc_class_name.u = u_memrchr(scope->name.u, ':', lc_class_name_len))) {
- lc_class_name.u++;
- lc_class_name_len -= (lc_class_name.u - scope->name.u);
- } else {
- lc_class_name = scope->name;
- }
+ if ((lc_class_name.u = u_memrchr(scope->name.u, ':', lc_class_name_len))) {
+ lc_class_name.u++;
+ lc_class_name_len -= (lc_class_name.u - scope->name.u);
} else {
- if ((lc_class_name.s = zend_memrchr(scope->name.s, ':', lc_class_name_len))) {
- lc_class_name.s++;
- lc_class_name_len -= (lc_class_name.s - scope->name.s);
- } else {
- lc_class_name = scope->name;
- }
+ lc_class_name = scope->name;
}
- lc_class_name = zend_u_str_case_fold(ZEND_STR_TYPE, lc_class_name, lc_class_name_len, 0, &lc_class_name_len);
+
+ lc_class_name = zend_u_str_case_fold(IS_UNICODE, lc_class_name, lc_class_name_len, 0, &lc_class_name_len);
}
while (ptr->fname) {
+ int len = strlen(ptr->fname)+1;
internal_function->handler = ptr->handler;
- if (UG(unicode)) {
- int len = strlen(ptr->fname)+1;
- internal_function->function_name.u = malloc(UBYTES(len));
- u_charsToUChars(ptr->fname, internal_function->function_name.u, len);
- } else {
- internal_function->function_name.s = (char*)ptr->fname;
- }
+ internal_function->function_name.u = malloc(UBYTES(len));
+ u_charsToUChars(ptr->fname, internal_function->function_name.u, len);
+
internal_function->scope = scope;
internal_function->prototype = NULL;
if (ptr->arg_info) {
- if (UG(unicode)) {
- zend_arg_info *args;
- int n = ptr->num_args;
-
- args = internal_function->arg_info = malloc((n + 1) * sizeof(zend_arg_info));
- memcpy(args, ptr->arg_info+1, (n + 1) * sizeof(zend_arg_info));
- while (n > 0) {
- --n;
- if (args[n].name.s) {
- UChar *uname = malloc(UBYTES(args[n].name_len + 1));
- u_charsToUChars(args[n].name.s, uname, args[n].name_len+1);
- args[n].name.u = uname;
- }
- if (args[n].class_name.s) {
- UChar *uname = malloc(UBYTES(args[n].class_name_len + 1));
- u_charsToUChars(args[n].class_name.s, uname, args[n].class_name_len+1);
- args[n].class_name.u = uname;
- }
+ zend_arg_info *args;
+ int n = ptr->num_args;
+
+ args = internal_function->arg_info = malloc((n + 1) * sizeof(zend_arg_info));
+ memcpy(args, ptr->arg_info+1, (n + 1) * sizeof(zend_arg_info));
+ while (n > 0) {
+ --n;
+ if (args[n].name.s) {
+ UChar *uname = malloc(UBYTES(args[n].name_len + 1));
+ u_charsToUChars(args[n].name.s, uname, args[n].name_len+1);
+ args[n].name.u = uname;
+ }
+ if (args[n].class_name.s) {
+ UChar *uname = malloc(UBYTES(args[n].class_name_len + 1));
+ u_charsToUChars(args[n].class_name.s, uname, args[n].class_name_len+1);
+ args[n].class_name.u = uname;
}
- } else {
- internal_function->arg_info = (zend_arg_info*)ptr->arg_info+1;
}
internal_function->num_args = ptr->num_args;
/* Currently you cannot denote that the function can accept less arguments than num_args */
* a constructor already.
*/
unsigned int lc_func_name_len;
- zstr lc_func_name = zend_u_str_case_fold(ZEND_STR_TYPE, internal_function->function_name, fname_len, 0, &lc_func_name_len);
+ zstr lc_func_name = zend_u_str_case_fold(IS_UNICODE, internal_function->function_name, fname_len, 0, &lc_func_name_len);
- if ((lc_func_name_len == lc_class_name_len) && !memcmp(lc_func_name.v, lc_class_name.v, UG(unicode)?UBYTES(lc_class_name_len):lc_class_name_len) && !ctor) {
+ if ((lc_func_name_len == lc_class_name_len) && !memcmp(lc_func_name.v, lc_class_name.v, UBYTES(lc_class_name_len)) && !ctor) {
ctor = reg_function;
} else if ((fname_len == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
ctor = reg_function;
zend_register_functions(class_entry, class_entry->builtin_functions, &class_entry->function_table, MODULE_PERSISTENT TSRMLS_CC);
}
- lcname = zend_u_str_case_fold(ZEND_STR_TYPE, class_entry->name, class_entry->name_length, 0, &lcname_len);
- zend_u_hash_update(CG(class_table), ZEND_STR_TYPE, lcname, lcname_len+1, &class_entry, sizeof(zend_class_entry *), NULL);
+ lcname = zend_u_str_case_fold(IS_UNICODE, class_entry->name, class_entry->name_length, 0, &lcname_len);
+ zend_u_hash_update(CG(class_table), IS_UNICODE, lcname, lcname_len+1, &class_entry, sizeof(zend_class_entry *), NULL);
efree(lcname.v);
return class_entry;
}
zstr method = mname;
int method_len = mlen;
- if (UG(unicode) && Z_TYPE_P(callable) == IS_STRING) {
+ if (Z_TYPE_P(callable) == IS_STRING) {
zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &method.u, &method_len, mname.s, mlen TSRMLS_CC);
- } else if (!UG(unicode) && Z_TYPE_P(callable) == IS_UNICODE) {
- zend_unicode_to_string(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &method.s, &method_len, mname.u, mlen TSRMLS_CC);
}
fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, method, method_len TSRMLS_CC);
if (method.v != mname.v) {
fcc->object_ptr = object_ptr;
fcc->calling_scope = Z_OBJCE_P(object_ptr);
if (callable_name) {
- if (UG(unicode)) {
- Z_TYPE_P(callable_name) = IS_UNICODE;
- Z_USTRLEN_P(callable_name) = fcc->calling_scope->name_length + Z_UNILEN_P(callable) + 2;
- Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
- memcpy(Z_USTRVAL_P(callable_name), fcc->calling_scope->name.u, UBYTES(fcc->calling_scope->name_length));
- Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length] = ':';
- Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length+1] = ':';
- if (Z_TYPE_P(callable) == IS_UNICODE) {
- u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL_P(callable), Z_USTRLEN_P(callable)+1);
- } else {
- zval *method = callable;
- zval copy;
- int use_copy;
-
- zend_make_unicode_zval(method, ©, &use_copy);
- u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL(copy), Z_USTRLEN(copy)+1);
- zval_dtor(©);
- }
+ Z_TYPE_P(callable_name) = IS_UNICODE;
+ Z_USTRLEN_P(callable_name) = fcc->calling_scope->name_length + Z_UNILEN_P(callable) + 2;
+ Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
+ memcpy(Z_USTRVAL_P(callable_name), fcc->calling_scope->name.u, UBYTES(fcc->calling_scope->name_length));
+ Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length] = ':';
+ Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length+1] = ':';
+ if (Z_TYPE_P(callable) == IS_UNICODE) {
+ u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL_P(callable), Z_USTRLEN_P(callable)+1);
} else {
- Z_TYPE_P(callable_name) = IS_STRING;
- Z_STRLEN_P(callable_name) = fcc->calling_scope->name_length + Z_UNILEN_P(callable) + 2;
- Z_STRVAL_P(callable_name) = emalloc(Z_STRLEN_P(callable_name)+1);
- memcpy(Z_STRVAL_P(callable_name), fcc->calling_scope->name.s, fcc->calling_scope->name_length);
- Z_STRVAL_P(callable_name)[fcc->calling_scope->name_length] = ':';
- Z_STRVAL_P(callable_name)[fcc->calling_scope->name_length+1] = ':';
- if (Z_TYPE_P(callable) == IS_STRING) {
- memcpy(Z_STRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_STRVAL_P(callable), Z_STRLEN_P(callable)+1);
- } else {
- zval *method = callable;
- zval copy;
- int use_copy;
+ zval *method = callable;
+ zval copy;
+ int use_copy;
- zend_make_string_zval(method, ©, &use_copy);
- memcpy(Z_STRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_STRVAL(copy), Z_STRLEN(copy)+1);
- zval_dtor(©);
- }
+ zend_make_unicode_zval(method, ©, &use_copy);
+ u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL(copy), Z_USTRLEN(copy)+1);
+ zval_dtor(©);
}
}
} else if (callable_name) {
*callable_name = *callable;
zval_copy_ctor(callable_name);
- convert_to_text(callable_name);
+ convert_to_unicode(callable_name);
}
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) {
fcc->called_scope = fcc->calling_scope;
if (Z_TYPE_PP(obj) == IS_STRING || Z_TYPE_PP(obj) == IS_UNICODE) {
if (callable_name) {
- if (UG(unicode)) {
- Z_TYPE_P(callable_name) = IS_UNICODE;
- Z_USTRLEN_P(callable_name) = Z_UNILEN_PP(obj) + Z_UNILEN_PP(method) + 2;
- Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
- if (Z_TYPE_PP(obj) == IS_UNICODE) {
- u_memcpy(Z_USTRVAL_P(callable_name), Z_USTRVAL_PP(obj), Z_USTRLEN_PP(obj));
- } else {
- zval copy;
- int use_copy;
-
- zend_make_unicode_zval(*obj, ©, &use_copy);
- u_memcpy(Z_USTRVAL_P(callable_name), Z_USTRVAL(copy), Z_USTRLEN(copy));
- zval_dtor(©);
- }
- Z_USTRVAL_P(callable_name)[Z_UNILEN_PP(obj)] = ':';
- Z_USTRVAL_P(callable_name)[Z_UNILEN_PP(obj)+1] = ':';
- if (Z_TYPE_PP(method) == IS_UNICODE) {
- u_memcpy(Z_USTRVAL_P(callable_name)+Z_UNILEN_PP(obj)+2, Z_USTRVAL_PP(method), Z_USTRLEN_PP(method)+1);
- } else {
- zval copy;
- int use_copy;
-
- zend_make_unicode_zval(*method, ©, &use_copy);
- u_memcpy(Z_USTRVAL_P(callable_name)+Z_UNILEN_PP(obj)+2, Z_USTRVAL(copy), Z_USTRLEN(copy)+1);
- zval_dtor(©);
- }
+ Z_TYPE_P(callable_name) = IS_UNICODE;
+ Z_USTRLEN_P(callable_name) = Z_UNILEN_PP(obj) + Z_UNILEN_PP(method) + 2;
+ Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
+ if (Z_TYPE_PP(obj) == IS_UNICODE) {
+ u_memcpy(Z_USTRVAL_P(callable_name), Z_USTRVAL_PP(obj), Z_USTRLEN_PP(obj));
+ } else {
+ zval copy;
+ int use_copy;
+
+ zend_make_unicode_zval(*obj, ©, &use_copy);
+ u_memcpy(Z_USTRVAL_P(callable_name), Z_USTRVAL(copy), Z_USTRLEN(copy));
+ zval_dtor(©);
+ }
+ Z_USTRVAL_P(callable_name)[Z_UNILEN_PP(obj)] = ':';
+ Z_USTRVAL_P(callable_name)[Z_UNILEN_PP(obj)+1] = ':';
+ if (Z_TYPE_PP(method) == IS_UNICODE) {
+ u_memcpy(Z_USTRVAL_P(callable_name)+Z_UNILEN_PP(obj)+2, Z_USTRVAL_PP(method), Z_USTRLEN_PP(method)+1);
} else {
- Z_TYPE_P(callable_name) = IS_STRING;
- Z_STRLEN_P(callable_name) = Z_UNILEN_PP(obj) + Z_UNILEN_PP(method) + 2;
- Z_STRVAL_P(callable_name) = emalloc(Z_STRLEN_P(callable_name)+1);
- if (Z_TYPE_PP(obj) == IS_STRING) {
- memcpy(Z_STRVAL_P(callable_name), Z_STRVAL_PP(obj), Z_STRLEN_PP(obj));
- } else {
- zval copy;
- int use_copy;
-
- zend_make_string_zval(*obj, ©, &use_copy);
- memcpy(Z_STRVAL_P(callable_name), Z_STRVAL(copy), Z_STRLEN(copy));
- zval_dtor(©);
- }
- Z_STRVAL_P(callable_name)[Z_UNILEN_PP(obj)] = ':';
- Z_STRVAL_P(callable_name)[Z_UNILEN_PP(obj)+1] = ':';
- if (Z_TYPE_PP(method) == IS_STRING) {
- memcpy(Z_STRVAL_P(callable_name)+Z_UNILEN_PP(obj)+2, Z_STRVAL_PP(method), Z_STRLEN_PP(method)+1);
- } else {
- zval copy;
- int use_copy;
-
- zend_make_string_zval(*method, ©, &use_copy);
- memcpy(Z_STRVAL_P(callable_name)+Z_UNILEN_PP(obj)+2, Z_STRVAL(copy), Z_STRLEN(copy)+1);
- zval_dtor(©);
- }
+ zval copy;
+ int use_copy;
+
+ zend_make_unicode_zval(*method, ©, &use_copy);
+ u_memcpy(Z_USTRVAL_P(callable_name)+Z_UNILEN_PP(obj)+2, Z_USTRVAL(copy), Z_USTRLEN(copy)+1);
+ zval_dtor(©);
}
}
fcc->object_ptr = *obj;
if (callable_name) {
- if (UG(unicode)) {
- Z_TYPE_P(callable_name) = IS_UNICODE;
- Z_USTRLEN_P(callable_name) = fcc->calling_scope->name_length + Z_UNILEN_PP(method) + 2;
- Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
- memcpy(Z_USTRVAL_P(callable_name), fcc->calling_scope->name.u, UBYTES(fcc->calling_scope->name_length));
- Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length] = ':';
- Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length+1] = ':';
- if (Z_TYPE_PP(method) == IS_UNICODE) {
- u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL_PP(method), Z_USTRLEN_PP(method)+1);
- } else {
- zval copy;
- int use_copy;
-
- zend_make_unicode_zval(*method, ©, &use_copy);
- u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL(copy), Z_USTRLEN(copy)+1);
- zval_dtor(©);
- }
+ Z_TYPE_P(callable_name) = IS_UNICODE;
+ Z_USTRLEN_P(callable_name) = fcc->calling_scope->name_length + Z_UNILEN_PP(method) + 2;
+ Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
+ memcpy(Z_USTRVAL_P(callable_name), fcc->calling_scope->name.u, UBYTES(fcc->calling_scope->name_length));
+ Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length] = ':';
+ Z_USTRVAL_P(callable_name)[fcc->calling_scope->name_length+1] = ':';
+ if (Z_TYPE_PP(method) == IS_UNICODE) {
+ u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL_PP(method), Z_USTRLEN_PP(method)+1);
} else {
- Z_TYPE_P(callable_name) = IS_STRING;
- Z_STRLEN_P(callable_name) = fcc->calling_scope->name_length + Z_UNILEN_PP(method) + 2;
- Z_STRVAL_P(callable_name) = emalloc(Z_STRLEN_P(callable_name)+1);
- memcpy(Z_STRVAL_P(callable_name), fcc->calling_scope->name.s, fcc->calling_scope->name_length);
- Z_STRVAL_P(callable_name)[fcc->calling_scope->name_length] = ':';
- Z_STRVAL_P(callable_name)[fcc->calling_scope->name_length+1] = ':';
- if (Z_TYPE_PP(method) == IS_STRING) {
- memcpy(Z_STRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_STRVAL_PP(method), Z_STRLEN_PP(method)+1);
- } else {
- zval copy;
- int use_copy;
-
- zend_make_string_zval(*method, ©, &use_copy);
- memcpy(Z_STRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_STRVAL(copy), Z_STRLEN(copy)+1);
- zval_dtor(©);
- }
+ zval copy;
+ int use_copy;
+
+ zend_make_unicode_zval(*method, ©, &use_copy);
+ u_memcpy(Z_USTRVAL_P(callable_name)+fcc->calling_scope->name_length+2, Z_USTRVAL(copy), Z_USTRLEN(copy)+1);
+ zval_dtor(©);
}
}
if (callable_name) {
zend_class_entry *ce = Z_OBJCE_P(callable); /* TBFixed: what if it's overloaded? */
- if (UG(unicode)) {
- Z_TYPE_P(callable_name) = IS_UNICODE;
- Z_USTRLEN_P(callable_name) = ce->name_length + sizeof("::__invoke") - 1;
- Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
- u_memcpy(Z_USTRVAL_P(callable_name), ce->name.u, ce->name_length);
- u_charsToUChars("::__invoke", Z_USTRVAL_P(callable_name) + ce->name_length, sizeof("::__invoke"));
- } else {
- Z_TYPE_P(callable_name) = IS_STRING;
- Z_STRLEN_P(callable_name) = ce->name_length + sizeof("::__invoke") - 1;
- Z_STRVAL_P(callable_name) = emalloc(Z_STRLEN_P(callable_name) + 1);
- memcpy(Z_STRVAL_P(callable_name), ce->name.s, ce->name_length);
- memcpy(Z_STRVAL_P(callable_name) + ce->name_length, "::__invoke", sizeof("::__invoke"));
- }
+ Z_TYPE_P(callable_name) = IS_UNICODE;
+ Z_USTRLEN_P(callable_name) = ce->name_length + sizeof("::__invoke") - 1;
+ Z_USTRVAL_P(callable_name) = eumalloc(Z_USTRLEN_P(callable_name)+1);
+ u_memcpy(Z_USTRVAL_P(callable_name), ce->name.u, ce->name_length);
+ u_charsToUChars("::__invoke", Z_USTRVAL_P(callable_name) + ce->name_length, sizeof("::__invoke"));
}
return 1;
}
if (callable_name) {
*callable_name = *callable;
zval_copy_ctor(callable_name);
- convert_to_text(callable_name);
+ convert_to_unicode(callable_name);
}
if (error) zend_spprintf(error, 0, "no array or string given");
return 0;
ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, int name_length, zval *property, int access_type, zstr doc_comment, int doc_comment_len TSRMLS_DC) /* {{{ */
{
- if (UG(unicode)) {
- zstr uname;
- int ret;
- ALLOCA_FLAG(use_heap)
+ zstr uname;
+ int ret;
+ ALLOCA_FLAG(use_heap)
- uname.u = do_alloca(UBYTES(name_length+1), use_heap);
- u_charsToUChars(name, uname.u, name_length+1);
- ret = zend_u_declare_property_ex(ce, IS_UNICODE, uname, name_length, property, access_type, doc_comment, doc_comment_len TSRMLS_CC);
- free_alloca(uname.u, use_heap);
- return ret;
- } else {
- return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, doc_comment, doc_comment_len TSRMLS_CC);
- }
+ uname.u = do_alloca(UBYTES(name_length+1), use_heap);
+ u_charsToUChars(name, uname.u, name_length+1);
+ ret = zend_u_declare_property_ex(ce, IS_UNICODE, uname, name_length, property, access_type, doc_comment, doc_comment_len TSRMLS_CC);
+ free_alloca(uname.u, use_heap);
+ return ret;
}
/* }}} */
ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_length, zval *property, int access_type TSRMLS_DC) /* {{{ */
{
- if (UG(unicode)) {
- zstr uname;
- int ret;
- ALLOCA_FLAG(use_heap)
+ zstr uname;
+ int ret;
+ ALLOCA_FLAG(use_heap)
- uname.u = do_alloca(UBYTES(name_length+1), use_heap);
- u_charsToUChars(name, uname.u, name_length+1);
- ret = zend_u_declare_property_ex(ce, IS_UNICODE, uname, name_length, property, access_type, NULL_ZSTR, 0 TSRMLS_CC);
- free_alloca(uname.u, use_heap);
- return ret;
- } else {
- return zend_u_declare_property_ex(ce, IS_STRING, ZSTR(name), name_length, property, access_type, NULL_ZSTR, 0 TSRMLS_CC);
- }
+ uname.u = do_alloca(UBYTES(name_length+1), use_heap);
+ u_charsToUChars(name, uname.u, name_length+1);
+ ret = zend_u_declare_property_ex(ce, IS_UNICODE, uname, name_length, property, access_type, NULL_ZSTR, 0 TSRMLS_CC);
+ free_alloca(uname.u, use_heap);
+ return ret;
}
/* }}} */
if (ce->type & ZEND_INTERNAL_CLASS) {
ALLOC_PERMANENT_ZVAL(property);
- if (UG(unicode)) {
- Z_TYPE_P(property) = IS_UNICODE;
- Z_USTRVAL_P(property) = malloc(UBYTES(len+1));
- u_charsToUChars(value, Z_USTRVAL_P(property), len+1);
- Z_USTRLEN_P(property) = len;
- } else {
- ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
- }
+ Z_TYPE_P(property) = IS_UNICODE;
+ Z_USTRVAL_P(property) = malloc(UBYTES(len+1));
+ u_charsToUChars(value, Z_USTRVAL_P(property), len+1);
+ Z_USTRLEN_P(property) = len;
} else {
ALLOC_ZVAL(property);
ZVAL_ASCII_STRINGL(property, value, len, 1);
if (ce->type & ZEND_INTERNAL_CLASS) {
ALLOC_PERMANENT_ZVAL(property);
- if (UG(unicode)) {
- Z_TYPE_P(property) = IS_UNICODE;
- Z_USTRVAL_P(property) = malloc(UBYTES(value_len+1));
- u_charsToUChars(value, Z_USTRVAL_P(property), value_len+1);
- Z_USTRLEN_P(property) = value_len;
- } else {
- ZVAL_STRINGL(property, zend_strndup(value, value_len), value_len, 0);
- }
+ Z_TYPE_P(property) = IS_UNICODE;
+ Z_USTRVAL_P(property) = malloc(UBYTES(value_len+1));
+ u_charsToUChars(value, Z_USTRVAL_P(property), value_len+1);
+ Z_USTRLEN_P(property) = value_len;
} else {
ALLOC_ZVAL(property);
ZVAL_ASCII_STRINGL(property, value, value_len, 1);
if (ce->type & ZEND_INTERNAL_CLASS) {
ALLOC_PERMANENT_ZVAL(constant);
- if (UG(unicode)) {
- Z_TYPE_P(constant) = IS_UNICODE;
- Z_USTRVAL_P(constant) = malloc(UBYTES(value_length+1));
- u_charsToUChars(value, Z_USTRVAL_P(constant), value_length+1);
- Z_USTRLEN_P(constant) = value_length;
- } else {
- ZVAL_STRINGL(constant, zend_strndup(value, value_length), value_length, 0);
- }
+ Z_TYPE_P(constant) = IS_UNICODE;
+ Z_USTRVAL_P(constant) = malloc(UBYTES(value_length+1));
+ u_charsToUChars(value, Z_USTRVAL_P(constant), value_length+1);
+ Z_USTRLEN_P(constant) = value_length;
} else {
ALLOC_ZVAL(constant);
ZVAL_ASCII_STRINGL(constant, value, value_length, 1);
ZEND_API zend_uchar zend_get_unified_string_type(int num_args TSRMLS_DC, ...) /* {{{ */
{
va_list ap;
- int best_type = ZEND_STR_TYPE;
+ int best_type = IS_UNICODE;
int type;
if (num_args <= 0) return (zend_uchar)-1;
#define INIT_OVERLOADED_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions, handle_fcall, handle_propget, handle_propset, handle_propunset, handle_propisset) \
{ \
int _len = class_name_len; \
- if (UG(unicode)) { \
- class_container.name.u = (UChar *)malloc(UBYTES(_len+1)); \
- u_charsToUChars(class_name, class_container.name.u, _len+1); \
- } else { \
- class_container.name.s = zend_strndup(class_name, _len); \
- } \
+ class_container.name.u = (UChar *)malloc(UBYTES(_len+1)); \
+ u_charsToUChars(class_name, class_container.name.u, _len+1); \
class_container.name_length = _len; \
class_container.builtin_functions = functions; \
class_container.constructor = NULL; \
ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value, int value_length TSRMLS_DC);
#define zend_update_property_text(ce, obj, key, key_len, str) \
- if (UG(unicode)) { \
- zend_update_property_unicode(ce, obj, key, key_len, (str).u TSRMLS_CC); \
- } else { \
- zend_update_property_string(ce, obj, key, key_len, (str).s TSRMLS_CC); \
- }
+ zend_update_property_unicode(ce, obj, key, key_len, (str).u TSRMLS_CC);
#define zend_update_property_textl(ce, obj, key, key_len, str, len) \
- if (UG(unicode)) { \
- zend_update_property_unicodel(ce, obj, key, key_len, str.u, len TSRMLS_CC); \
- } else { \
- zend_update_property_stringl(ce, obj, key, key_len, str.s, len TSRMLS_CC); \
- }
+ zend_update_property_unicodel(ce, obj, key, key_len, str.u, len TSRMLS_CC);
ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, int name_length, zval *value TSRMLS_DC);
add_assoc_zval_ex(arg, key, key_len, ___tmp); \
} while (0)
#define add_assoc_text_ex(arg, key, key_len, str, duplicate) do { \
- if (UG(unicode)) { \
- add_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
- } else { \
- add_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \
- } \
+ add_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
} while (0)
#define add_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
- } else { \
- add_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \
- } \
+ add_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
} while (0)
#define add_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } else { \
- add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
+ add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
} while (0)
#define add_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_assoc_string_ex(arg, key, key_len, str, flags) add_assoc_stringl_ex(arg, key, key_len, str, strlen(str), flags)
add_ascii_assoc_zval_ex(arg, key, key_len, ___tmp); \
} while (0)
#define add_ascii_assoc_text_ex(arg, key, key_len, str, duplicate) do { \
- if (UG(unicode)) { \
- add_ascii_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
- } else { \
- add_ascii_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \
- } \
+ add_ascii_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
} while (0)
#define add_ascii_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_ascii_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
- } else { \
- add_ascii_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \
- } \
+ add_ascii_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
} while (0)
#define add_ascii_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } else { \
- add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
+ add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
} while (0)
#define add_ascii_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_ascii_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_ascii_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_ascii_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
add_rt_assoc_zval_ex(arg, key, key_len, ___tmp); \
} while (0)
#define add_rt_assoc_text_ex(arg, key, key_len, str, duplicate) do { \
- if (UG(unicode)) { \
- add_rt_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
- } else { \
- add_rt_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \
- } \
+ add_rt_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
} while (0)
#define add_rt_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_rt_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
- } else { \
- add_rt_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \
- } \
+ add_rt_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
} while (0)
#define add_rt_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } else { \
- add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
+ add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
} while (0)
#define add_rt_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_rt_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_rt_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_rt_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
add_utf8_assoc_zval_ex(arg, key, key_len, ___tmp); \
} while (0)
#define add_utf8_assoc_text_ex(arg, key, key_len, str, duplicate) do { \
- if (UG(unicode)) { \
- add_utf8_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
- } else { \
- add_utf8_assoc_string_ex(arg, key, key_len, (str).s, duplicate); \
- } \
+ add_utf8_assoc_unicode_ex(arg, key, key_len, (str).u, duplicate); \
} while (0)
#define add_utf8_assoc_textl_ex(arg, key, key_len, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_utf8_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
- } else { \
- add_utf8_assoc_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \
- } \
+ add_utf8_assoc_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
} while (0)
#define add_utf8_assoc_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } else { \
- add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
+ add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
} while (0)
#define add_utf8_assoc_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_utf8_assoc_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_utf8_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_utf8_assoc_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
zval_ptr_dtor(&___tmp); /* write_property will add 1 to refcount */ \
} while (0)
#define add_utf8_property_text_ex(arg, key, key_len, str, duplicate) do { \
- if (UG(unicode)) { \
- add_utf8_property_unicode_ex(arg, key, key_len, (str).u, duplicate); \
- } else { \
- add_utf8_property_string_ex(arg, key, key_len, (str).s, duplicate); \
- } \
+ add_utf8_property_unicode_ex(arg, key, key_len, (str).u, duplicate); \
} while (0)
#define add_utf8_property_textl_ex(arg, key, key_len, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_utf8_property_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
- } else { \
- add_utf8_property_stringl_ex(arg, key, key_len, (str).s, length, duplicate); \
- } \
+ add_utf8_property_unicodel_ex(arg, key, key_len, (str).u, length, duplicate); \
} while (0)
#define add_utf8_property_ascii_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } else { \
- add_utf8_property_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
+ add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
} while (0)
#define add_utf8_property_rt_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_utf8_property_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_utf8_property_utf8_stringl_ex(arg, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_utf8_property_stringl_ex(arg, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_utf8_property_unicodel_ex(arg, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
add_u_assoc_zval_ex(arg, key_type, key, key_len, ___tmp); \
} while (0)
#define add_u_assoc_text_ex(arg, type, key, key_len, str, duplicate) do { \
- if (UG(unicode)) { \
- add_u_assoc_unicode_ex(arg, type, key, key_len, (str).u, duplicate); \
- } else { \
- add_u_assoc_string_ex(arg, type, key, key_len, (str).s, duplicate); \
- } \
+ add_u_assoc_unicode_ex(arg, type, key, key_len, (str).u, duplicate); \
} while (0)
#define add_u_assoc_textl_ex(arg, type, key, key_len, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_u_assoc_unicodel_ex(arg, type, key, key_len, (str).u, length, duplicate); \
- } else { \
- add_u_assoc_stringl_ex(arg, type, key, key_len, (str).s, length, duplicate); \
- } \
+ add_u_assoc_unicodel_ex(arg, type, key, key_len, (str).u, length, duplicate); \
} while (0)
#define add_u_assoc_ascii_stringl_ex(arg, type, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
- } else { \
- add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
+ add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
} while (0)
#define add_u_assoc_rt_stringl_ex(arg, type, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_u_assoc_utf8_stringl_ex(arg, type, key, key_len, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_u_assoc_stringl_ex(arg, type, key, key_len, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_u_assoc_unicodel_ex(arg, type, key, key_len, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
add_index_zval(arg, idx, ___tmp); \
} while (0)
#define add_index_text(arg, idx, str, duplicate) do { \
- if (UG(unicode)) { \
- add_index_unicode(arg, idx, (str).u, duplicate); \
- } else { \
- add_index_string(arg, idx, (str).s, duplicate); \
- } \
+ add_index_unicode(arg, idx, (str).u, duplicate); \
} while (0)
#define add_index_textl(arg, idx, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_index_unicodel(arg, idx, (str).u, length, duplicate); \
- } else { \
- add_index_stringl(arg, idx, (str).s, length, duplicate); \
- } \
+ add_index_unicodel(arg, idx, (str).u, length, duplicate); \
} while (0)
#define add_index_ascii_stringl(arg, idx, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
- } else { \
- add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
+ add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
} while (0)
#define add_index_rt_stringl(arg, idx, str, length, flags) do {\
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
#define add_index_utf8_stringl(arg, idx, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(str); \
- } \
- } else { \
- add_index_stringl(arg, idx, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_index_unicodel(arg, idx, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(str); \
} \
} while (0)
add_next_index_zval(arg, ___tmp); \
} while (0)
#define add_next_index_text(arg, str, duplicate) do { \
- if (UG(unicode)) { \
- add_next_index_unicode(arg, (str).u, duplicate); \
- } else { \
- add_next_index_string(arg, (str).s, duplicate); \
- } \
+ add_next_index_unicode(arg, (str).u, duplicate); \
} while (0)
#define add_next_index_textl(arg, str, length, duplicate) do { \
- if (UG(unicode)) { \
- add_next_index_unicodel(arg, (str).u, length, duplicate); \
- } else { \
- add_next_index_stringl(arg, (str).s, length, duplicate); \
- } \
+ add_next_index_unicodel(arg, (str).u, length, duplicate); \
} while (0)
#define add_next_index_ascii_stringl(arg, str, length, flags) do { \
- if (UG(unicode)) { \
- int ___u_len = length; \
- UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
- ___u_str[___u_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree((char*)(str)); \
- } \
- add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
- } else { \
- add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ int ___u_len = length; \
+ UChar *___u_str = zend_ascii_to_unicode((str), (___u_len)+1 ZEND_FILE_LINE_CC); \
+ ___u_str[___u_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree((char*)(str)); \
} \
+ add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
} while (0)
#define add_next_index_rt_stringl(arg, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree((char*)(str)); \
- } \
- } else { \
- add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree((char*)(str)); \
} \
} while (0)
#define add_next_index_utf8_stringl(arg, str, length, flags) do { \
- if (UG(unicode)) { \
- UChar *___u_str; \
- int ___u_len; \
- if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
- add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree((char*)(str)); \
- } \
- } else { \
- add_next_index_stringl(arg, (char*)(str), length, (flags) & ZSTR_DUPLICATE); \
+ UChar *___u_str; \
+ int ___u_len; \
+ if (zend_string_to_unicode(UG(utf8_conv), &___u_str, &___u_len, str, length TSRMLS_CC) == SUCCESS) { \
+ add_next_index_unicodel(arg, ___u_str, ___u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree((char*)(str)); \
} \
} while (0)
}
#define ZVAL_ASCII_STRING(z, s, flags) { \
- if (UG(unicode)) { \
- char *__s = (char*)(s); \
- int __s_len = strlen(__s); \
- UChar *u_str = zend_ascii_to_unicode(__s, __s_len+1 ZEND_FILE_LINE_CC); \
- u_str[__s_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(__s); \
- } \
- ZVAL_UNICODEL(z, u_str, __s_len, 0); \
- } else { \
- const char *__s=(s); \
- Z_STRLEN_P(z) = strlen(__s); \
- Z_STRVAL_P(z) = (((flags) & ZSTR_DUPLICATE) ? estrndup(__s, Z_STRLEN_P(z)) :(char*) __s); \
- Z_TYPE_P(z) = IS_STRING; \
+ char *__s = (char*)(s); \
+ int __s_len = strlen(__s); \
+ UChar *u_str = zend_ascii_to_unicode(__s, __s_len+1 ZEND_FILE_LINE_CC); \
+ u_str[__s_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(__s); \
} \
+ ZVAL_UNICODEL(z, u_str, __s_len, 0); \
}
#define ZVAL_ASCII_STRINGL(z, s, l, flags) { \
- if (UG(unicode)) { \
- char *__s = (char*)(s); \
- int __s_len = (l); \
- UChar *u_str = zend_ascii_to_unicode((__s), (__s_len)+1 ZEND_FILE_LINE_CC); \
- u_str[__s_len] = 0; \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(__s); \
- } \
- ZVAL_UNICODEL(z, u_str, __s_len, 0); \
- } else { \
- const char *__s=(s); int __l=l; \
- Z_STRLEN_P(z) = __l; \
- Z_STRVAL_P(z) = (((flags) & ZSTR_DUPLICATE) ? estrndup(__s, __l) : (char*)__s); \
- Z_TYPE_P(z) = IS_STRING; \
+ char *__s = (char*)(s); \
+ int __s_len = (l); \
+ UChar *u_str = zend_ascii_to_unicode((__s), (__s_len)+1 ZEND_FILE_LINE_CC); \
+ u_str[__s_len] = 0; \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(__s); \
} \
+ ZVAL_UNICODEL(z, u_str, __s_len, 0); \
}
#define ZVAL_U_STRING(conv, z, s, flags) { \
- if (UG(unicode)) { \
- char *__s = (char *)(s); \
- int __s_len = strlen(__s); \
- UChar *u_str; \
- int u_len; \
- if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len TSRMLS_CC) == SUCCESS) { \
- ZVAL_UNICODEL(z, u_str, u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(__s); \
- } \
- } else { \
- char *__s=(char *)(s); \
- Z_STRLEN_P(z) = strlen(__s); \
- Z_STRVAL_P(z) = (((flags) & ZSTR_DUPLICATE) ? estrndup(__s, Z_STRLEN_P(z)) : (char*)__s); \
- Z_TYPE_P(z) = IS_STRING; \
+ char *__s = (char *)(s); \
+ int __s_len = strlen(__s); \
+ UChar *u_str; \
+ int u_len; \
+ if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len TSRMLS_CC) == SUCCESS) { \
+ ZVAL_UNICODEL(z, u_str, u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(__s); \
} \
}
#define ZVAL_U_STRINGL(conv, z, s, l, flags) { \
- if (UG(unicode)) { \
- char *__s = (char *)(s); \
- int __s_len = (l); \
- UChar *u_str; \
- int u_len; \
- if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len TSRMLS_CC) == SUCCESS) { \
- ZVAL_UNICODEL(z, u_str, u_len, 0); \
- } \
- if ((flags) & ZSTR_AUTOFREE) { \
- efree(__s); \
- } \
- } else { \
- char *__s=(char *)(s); int __l=l; \
- Z_STRLEN_P(z) = __l; \
- Z_STRVAL_P(z) = (((flags) & ZSTR_DUPLICATE) ? estrndup(__s, __l) : __s); \
- Z_TYPE_P(z) = IS_STRING; \
+ char *__s = (char *)(s); \
+ int __s_len = (l); \
+ UChar *u_str; \
+ int u_len; \
+ if (zend_string_to_unicode(conv, &u_str, &u_len, __s, __s_len TSRMLS_CC) == SUCCESS) { \
+ ZVAL_UNICODEL(z, u_str, u_len, 0); \
+ } \
+ if ((flags) & ZSTR_AUTOFREE) { \
+ efree(__s); \
} \
}
#define ZVAL_TEXT(z, t, duplicate) \
do { \
- if (UG(unicode)) { \
- ZVAL_UNICODE(z, t.u, duplicate); \
- } else { \
- ZVAL_STRING(z, t.s, duplicate); \
- } \
+ ZVAL_UNICODE(z, t.u, duplicate); \
} while (0);
#define ZVAL_TEXTL(z, t, l, duplicate) \
do { \
- if (UG(unicode)) { \
- ZVAL_UNICODEL(z, t.u, l, duplicate);\
- } else { \
- ZVAL_STRINGL(z, t.s, l, duplicate); \
- } \
+ ZVAL_UNICODEL(z, t.u, l, duplicate); \
} while (0);
#define ZVAL_EMPTY_TEXT(z) \
- if (UG(unicode)) { \
- ZVAL_EMPTY_UNICODE(z); \
- } else { \
- ZVAL_EMPTY_STRING(z); \
- }
+ ZVAL_EMPTY_UNICODE(z);
#define ZVAL_ENC_STRINGL(z, t, conv, s, l, flags) { \
if (t == IS_UNICODE) { \
goto repeat;
} else if (Z_OBJ_HT_P(val)->cast_object) {
ALLOC_INIT_ZVAL(val_free);
- if (Z_OBJ_HT_P(val)->cast_object(val, val_free, UG(unicode)?IS_UNICODE:IS_STRING, NULL TSRMLS_CC) == SUCCESS) {
+ if (Z_OBJ_HT_P(val)->cast_object(val, val_free, IS_UNICODE, NULL TSRMLS_CC) == SUCCESS) {
val = val_free;
break;
}
} else {
ce = zend_get_class_entry(arg TSRMLS_CC);
}
- } else if (Z_TYPE_P(arg) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
+ } else if (Z_TYPE_P(arg) == IS_UNICODE) {
zend_class_entry **pce;
if (zend_u_lookup_class(Z_TYPE_P(arg), Z_UNIVAL_P(arg), Z_UNILEN_P(arg), &pce TSRMLS_CC) == SUCCESS) {
return;
}
- if (only_subclass && Z_TYPE_P(obj) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
+ if (only_subclass && Z_TYPE_P(obj) == IS_UNICODE) {
zend_class_entry **the_ce;
if (zend_u_lookup_class(Z_TYPE_P(obj), Z_UNIVAL_P(obj), Z_UNILEN_P(obj), &the_ce TSRMLS_CC) == FAILURE) {
zend_error(E_WARNING, "Unknown class passed as parameter");
zend_hash_internal_pointer_reset_ex(properties, &pos);
while (zend_hash_get_current_data_ex(properties, (void **) &value, &pos) == SUCCESS) {
- if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos) == (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING)) {
- if (zend_check_property_access(zobj, ZEND_STR_TYPE, key, key_len-1 TSRMLS_CC) == SUCCESS) {
- zend_u_unmangle_property_name(ZEND_STR_TYPE, key, key_len-1, &class_name, &prop_name);
+ if (zend_hash_get_current_key_ex(properties, &key, &key_len, &num_index, 0, &pos) == HASH_KEY_IS_UNICODE) {
+ if (zend_check_property_access(zobj, IS_UNICODE, key, key_len-1 TSRMLS_CC) == SUCCESS) {
+ zend_u_unmangle_property_name(IS_UNICODE, key, key_len-1, &class_name, &prop_name);
/* Not separating references */
Z_ADDREF_PP(value);
- add_u_assoc_zval(return_value, ZEND_STR_TYPE, prop_name, *value);
+ add_u_assoc_zval(return_value, IS_UNICODE, prop_name, *value);
}
}
zend_hash_move_forward_ex(properties, &pos);
RETURN_FALSE;
}
ce = Z_OBJCE_P(klass);
- } else if (Z_TYPE_P(klass) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
+ } else if (Z_TYPE_P(klass) == IS_UNICODE) {
if (zend_u_lookup_class(Z_TYPE_P(klass), Z_UNIVAL_P(klass), Z_UNILEN_P(klass), &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
}
zstr key;
uint key_len;
ulong num_index;
- uint len = UG(unicode)?u_strlen(mptr->common.function_name.u):strlen(mptr->common.function_name.s);
+ uint len = u_strlen(mptr->common.function_name.u);
/* Do not display old-style inherited constructors */
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
mptr->common.scope == ce ||
- zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING) ||
- (UG(unicode) ?
- (zend_u_binary_strcasecmp(key.u, key_len-1, mptr->common.function_name.u, len) == 0) :
- (zend_binary_strcasecmp(key.s, key_len-1, mptr->common.function_name.s, len) == 0))) {
+ zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_UNICODE ||
+ (zend_u_binary_strcasecmp(key.u, key_len-1, mptr->common.function_name.u, len) == 0)) {
MAKE_STD_ZVAL(method_name);
ZVAL_TEXT(method_name, mptr->common.function_name, 1);
if (Z_TYPE_P(klass) == IS_OBJECT) {
ce = Z_OBJCE_P(klass);
- } else if (Z_TYPE_P(klass) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
+ } else if (Z_TYPE_P(klass) == IS_UNICODE) {
if (zend_u_lookup_class(Z_TYPE_P(klass), Z_UNIVAL_P(klass), Z_UNILEN_P(klass), &pce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
array_init(return_value);
zend_hash_internal_pointer_reset_ex(&EG(included_files), &pos);
while (zend_hash_get_current_key_ex(&EG(included_files), &entry, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING) {
- if (UG(unicode) && SUCCESS == zend_path_decode(&ustr, &ustr_len, entry.s, len - 1 TSRMLS_CC)) {
+ if (SUCCESS == zend_path_decode(&ustr, &ustr_len, entry.s, len - 1 TSRMLS_CC)) {
add_next_index_unicodel(return_value, ustr, ustr_len, 0);
} else {
add_next_index_stringl(return_value, entry.s, len - 1, 1);
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, &new_function, sizeof(zend_function), NULL)==FAILURE);
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETVAL_ASCII_STRINGL(function_name, function_name_length, 0);
- if (UG(unicode)) {
- efree(function_name);
- }
+ efree(function_name);
} else {
RETURN_FALSE;
}
*const_val = constant->value;
zval_copy_ctor(const_val);
INIT_PZVAL(const_val);
- add_u_assoc_zval_ex(name_array, UG(unicode)?IS_UNICODE:IS_STRING, constant->name, constant->name_len, const_val);
+ add_u_assoc_zval_ex(name_array, IS_UNICODE, constant->name, constant->name_len, const_val);
return 0;
}
/* }}} */
zval_copy_ctor(const_val);
INIT_PZVAL(const_val);
- add_u_assoc_zval_ex(modules[module_number], UG(unicode)?IS_UNICODE:IS_STRING, val->name, val->name_len, const_val);
+ add_u_assoc_zval_ex(modules[module_number], IS_UNICODE, val->name, val->name_len, const_val);
bad_module_id:
zend_hash_move_forward_ex(EG(zend_constants), &pos);
function_name = ptr->function_state.function->common.function_name;
if (function_name.v) {
- function_name_string = !UG(unicode);
+ function_name_string = 0;
if (ptr->object) {
if (ptr->function_state.function->common.scope) {
class_name = ptr->function_state.function->common.scope->name;
}
zend_printf("#%-2d ", indent);
if (class_name.v) {
- if (UG(unicode)) {
- zend_printf("%r", class_name.u);
- } else {
- ZEND_PUTS(class_name.s);
- }
+ zend_printf("%r", class_name.u);
ZEND_PUTS(call_type);
}
if (function_name_string) {
invoke->internal_function.handler = ZEND_MN(Closure___invoke);
invoke->internal_function.module = 0;
invoke->internal_function.scope = zend_ce_closure;
- if (UG(unicode)) {
- invoke->internal_function.function_name.u = USTR_MAKE(ZEND_INVOKE_FUNC_NAME);
- } else {
- invoke->internal_function.function_name.s = estrndup(ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1);
- }
+ invoke->internal_function.function_name.u = USTR_MAKE(ZEND_INVOKE_FUNC_NAME);
+
return invoke;
}
/* }}} */
{
unsigned int lc_name_len;
zstr lc_name;
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
/* Create a zend_copy_str_tolower(dest, src, src_length); */
- lc_name = zend_u_str_case_fold(type, method_name, method_len, 1, &lc_name_len);
+ lc_name = zend_u_str_case_fold(IS_UNICODE, method_name, method_len, 1, &lc_name_len);
if ((lc_name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) &&
- (ZEND_U_EQUAL(type, lc_name, lc_name_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1))
+ (ZEND_U_EQUAL(IS_UNICODE, lc_name, lc_name_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1))
) {
efree(lc_name.v);
return zend_get_closure_invoke_method(*object_ptr TSRMLS_CC);
static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */
{
- TSRMLS_FETCH();
-
- if (UG(unicode)) {
- property_info->name.u = eustrndup(property_info->name.u, property_info->name_length);
- if (property_info->doc_comment.u) {
- property_info->doc_comment.u = eustrndup(property_info->doc_comment.u, property_info->doc_comment_len);
- }
- } else {
- property_info->name.s = estrndup(property_info->name.s, property_info->name_length);
- if (property_info->doc_comment.s) {
- property_info->doc_comment.s = estrndup(property_info->doc_comment.s, property_info->doc_comment_len);
- }
+ property_info->name.u = eustrndup(property_info->name.u, property_info->name_length);
+ if (property_info->doc_comment.u) {
+ property_info->doc_comment.u = eustrndup(property_info->doc_comment.u, property_info->doc_comment_len);
}
}
/* }}} */
static void zend_duplicate_property_info_internal(zend_property_info *property_info) /* {{{ */
{
- TSRMLS_FETCH();
-
- if (UG(unicode)) {
- property_info->name.u = zend_ustrndup(property_info->name.u, property_info->name_length);
- } else {
- property_info->name.s = zend_strndup(property_info->name.s, property_info->name_length);
- }
+ property_info->name.u = zend_ustrndup(property_info->name.u, property_info->name_length);
}
/* }}} */
if (varname->op_type == IS_CONST) {
if (Z_TYPE(varname->u.constant) != IS_STRING &&
Z_TYPE(varname->u.constant) != IS_UNICODE) {
- convert_to_text(&varname->u.constant);
+ convert_to_unicode(&varname->u.constant);
}
is_auto_global = zend_u_is_auto_global_ex(Z_TYPE(varname->u.constant), Z_UNIVAL(varname->u.constant), Z_UNILEN(varname->u.constant), 0, &auto_global TSRMLS_CC);
if (!is_auto_global &&
unsigned int short_class_name_length;
zstr short_class_lcname;
- if (UG(unicode)) {
- if ((short_class_name.u = u_memrchr(CG(active_class_entry)->name.u, '\\', CG(active_class_entry)->name_length))) {
- short_class_name_length = CG(active_class_entry)->name_length - (short_class_name.u - CG(active_class_entry)->name.u) - 1;
- short_class_name.u++;
- } else {
- short_class_name = CG(active_class_entry)->name;
- short_class_name_length = CG(active_class_entry)->name_length;
- }
+ if ((short_class_name.u = u_memrchr(CG(active_class_entry)->name.u, '\\', CG(active_class_entry)->name_length))) {
+ short_class_name_length = CG(active_class_entry)->name_length - (short_class_name.u - CG(active_class_entry)->name.u) - 1;
+ short_class_name.u++;
} else {
- if ((short_class_name.s = zend_memrchr(CG(active_class_entry)->name.s, '\\', CG(active_class_entry)->name_length))) {
- short_class_name_length = CG(active_class_entry)->name_length - (short_class_name.s - CG(active_class_entry)->name.s) - 1;
- short_class_name.s++;
- } else {
- short_class_name = CG(active_class_entry)->name;
- short_class_name_length = CG(active_class_entry)->name_length;
- }
+ short_class_name = CG(active_class_entry)->name;
+ short_class_name_length = CG(active_class_entry)->name_length;
}
- short_class_lcname = zend_u_str_case_fold(UG(unicode)?IS_UNICODE:IS_STRING, short_class_name, short_class_name_length, 0, &short_class_name_length);
+ short_class_lcname = zend_u_str_case_fold(IS_UNICODE, short_class_name, short_class_name_length, 0, &short_class_name_length);
/* Improve after RC: cache the lowercase class name */
- if ((short_class_name_length == name_len) && (!memcmp(short_class_lcname.v, lcname.v, UG(unicode)?UBYTES(lcname_len):lcname_len))) {
+ if ((short_class_name_length == name_len) && (!memcmp(short_class_lcname.v, lcname.v, UBYTES(lcname_len)))) {
if (CG(active_class_entry)->constructor) {
zend_error(E_STRICT, "Redefining already defined constructor for class %v", CG(active_class_entry)->name);
} else {
/* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
- if (UG(unicode)) {
- utype = IS_UNICODE;
- name_len = u_strlen(CG(active_op_array)->function_name.u);
- lcname = zend_u_str_case_fold(utype, CG(active_op_array)->function_name, name_len, 0, &lcname_len);
- } else {
- utype = IS_STRING;
- lcname_len = name_len = strlen(CG(active_op_array)->function_name.s);
- zend_str_tolower_copy(lcname_buf, CG(active_op_array)->function_name.s, MIN(name_len, sizeof(lcname_buf)-1));
- lcname_buf[sizeof(lcname_buf)-1] = '\0'; /* zend_str_tolower_copy won't necessarily set the zero byte */
- lcname.s = lcname_buf;
- }
+ utype = IS_UNICODE;
+ name_len = u_strlen(CG(active_op_array)->function_name.u);
+ lcname = zend_u_str_case_fold(utype, CG(active_op_array)->function_name, name_len, 0, &lcname_len);
if (lcname_len == sizeof(ZEND_AUTOLOAD_FUNC_NAME) - 1 &&
ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1) &&
CG(active_op_array)->num_args != 1) {
zend_arg_info *cur_arg_info;
if (class_type->op_type == IS_CONST &&
- Z_TYPE(class_type->u.constant) == ZEND_STR_TYPE &&
+ Z_TYPE(class_type->u.constant) == IS_UNICODE &&
Z_UNILEN(class_type->u.constant) == 0) {
/* Usage of namespace as class name not in namespace */
zval_dtor(&class_type->u.constant);
if (Z_TYPE(initialization->u.constant) == IS_NULL ||
(Z_TYPE(initialization->u.constant) == IS_CONSTANT &&
Z_UNILEN(initialization->u.constant) == sizeof("null") - 1 &&
- ZEND_U_CASE_EQUAL(UG(unicode)?IS_UNICODE:IS_STRING, Z_UNIVAL(initialization->u.constant), Z_UNILEN(initialization->u.constant), "null", sizeof("null")-1))) {
+ ZEND_U_CASE_EQUAL(IS_UNICODE, Z_UNIVAL(initialization->u.constant), Z_UNILEN(initialization->u.constant), "null", sizeof("null")-1))) {
cur_arg_info->allow_null = 1;
} else {
zend_error(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
if (Z_TYPE(initialization->u.constant) == IS_NULL ||
(Z_TYPE(initialization->u.constant) == IS_CONSTANT &&
Z_UNILEN(initialization->u.constant) == sizeof("null") - 1 &&
- ZEND_U_CASE_EQUAL(UG(unicode)?IS_UNICODE:IS_STRING, Z_UNIVAL(initialization->u.constant), Z_UNILEN(initialization->u.constant), "null", sizeof("null")-1))) {
+ ZEND_U_CASE_EQUAL(IS_UNICODE, Z_UNIVAL(initialization->u.constant), Z_UNILEN(initialization->u.constant), "null", sizeof("null")-1))) {
cur_arg_info->allow_null = 1;
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) {
zend_error(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
zend_op *opline;
if (class_name->op_type == IS_CONST &&
- Z_TYPE(class_name->u.constant) == ZEND_STR_TYPE &&
+ Z_TYPE(class_name->u.constant) == IS_UNICODE &&
Z_UNILEN(class_name->u.constant) == 0) {
/* Usage of namespace as class name not in namespace */
zval_dtor(&class_name->u.constant);
zend_error(E_DEPRECATED,
"Call-time pass-by-reference has been deprecated; "
"if you would like to pass argument by reference, modify the declaration of %R().",
- UG(unicode)?IS_UNICODE:IS_STRING,
+ IS_UNICODE,
function_ptr->common.function_name.v);
} else{
zend_error(E_DEPRECATED,
zend_u_hash_init(op_array->static_variables, zend_hash_num_elements(static_variables), NULL, ZVAL_PTR_DTOR, 0, UG(unicode));
zend_hash_copy(op_array->static_variables, static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_zval, sizeof(zval *));
}
- } else if (UG(unicode) && function->type == ZEND_INTERNAL_FUNCTION) {
+ } else if (function->type == ZEND_INTERNAL_FUNCTION) {
zend_internal_function *func = &function->internal_function;
func->function_name.u = zend_ustrndup(func->function_name.u, u_strlen(func->function_name.u));
if (!zend_ascii_hash_exists(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME))) {
unsigned int lc_parent_class_name_len;
zend_function *function;
- zstr lc_parent_class_name = zend_u_str_case_fold(ZEND_STR_TYPE, ce->parent->name, ce->parent->name_length, 0, &lc_parent_class_name_len);
+ zstr lc_parent_class_name = zend_u_str_case_fold(IS_UNICODE, ce->parent->name, ce->parent->name_length, 0, &lc_parent_class_name_len);
- if (!zend_u_hash_exists(&ce->function_table, ZEND_STR_TYPE, lc_parent_class_name, ce->parent->name_length+1) &&
- zend_u_hash_find(&ce->parent->function_table, ZEND_STR_TYPE, lc_parent_class_name, ce->parent->name_length+1, (void **)&function)==SUCCESS) {
+ if (!zend_u_hash_exists(&ce->function_table, IS_UNICODE, lc_parent_class_name, ce->parent->name_length+1) &&
+ zend_u_hash_find(&ce->parent->function_table, IS_UNICODE, lc_parent_class_name, ce->parent->name_length+1, (void **)&function)==SUCCESS) {
if (function->common.fn_flags & ZEND_ACC_CTOR) {
/* inherit parent's constructor */
- zend_u_hash_update(&ce->function_table, ZEND_STR_TYPE, lc_parent_class_name, ce->parent->name_length+1, function, sizeof(zend_function), NULL);
+ zend_u_hash_update(&ce->function_table, IS_UNICODE, lc_parent_class_name, ce->parent->name_length+1, function, sizeof(zend_function), NULL);
function_add_ref(function TSRMLS_CC);
}
}
}
if (fe->common.arg_info[i].class_name.v &&
(fe->common.arg_info[i].class_name_len != proto->common.arg_info[i].class_name_len ||
- (!UG(unicode) && zend_binary_strcasecmp(fe->common.arg_info[i].class_name.s, fe->common.arg_info[i].class_name_len, proto->common.arg_info[i].class_name.s, proto->common.arg_info[i].class_name_len) != 0) ||
- (UG(unicode) && zend_u_binary_strcasecmp(fe->common.arg_info[i].class_name.u, fe->common.arg_info[i].class_name_len, proto->common.arg_info[i].class_name.u, proto->common.arg_info[i].class_name_len) != 0))) {
-
+ (zend_u_binary_strcasecmp(fe->common.arg_info[i].class_name.u, fe->common.arg_info[i].class_name_len, proto->common.arg_info[i].class_name.u, proto->common.arg_info[i].class_name_len) != 0))) {
zstr colon;
if (fe->common.type != ZEND_USER_FUNCTION ||
- ((!UG(unicode) ||
- u_strchr(proto->common.arg_info[i].class_name.u, ':') != NULL ||
+ ((u_strchr(proto->common.arg_info[i].class_name.u, ':') != NULL ||
(colon.u = u_memrchr(fe->common.arg_info[i].class_name.u, ':', fe->common.arg_info[i].class_name_len)) == NULL ||
fe->common.arg_info[i].class_name_len - (colon.u + 1 - fe->common.arg_info[i].class_name.u) != proto->common.arg_info[i].class_name_len ||
zend_u_binary_strcasecmp(colon.u + 1, proto->common.arg_info[i].class_name_len, proto->common.arg_info[i].class_name.u, proto->common.arg_info[i].class_name_len) != 0) &&
- (UG(unicode) ||
- strchr(proto->common.arg_info[i].class_name.s, ':') != NULL ||
+ (strchr(proto->common.arg_info[i].class_name.s, ':') != NULL ||
(colon.s = zend_memrchr(fe->common.arg_info[i].class_name.s, ':', fe->common.arg_info[i].class_name_len)) == NULL ||
fe->common.arg_info[i].class_name_len - (colon.s + 1 - fe->common.arg_info[i].class_name.s) != proto->common.arg_info[i].class_name_len ||
zend_binary_strcasecmp(colon.s + 1, proto->common.arg_info[i].class_name_len, proto->common.arg_info[i].class_name.s, proto->common.arg_info[i].class_name_len) != 0))) {
zend_uchar utype;
TSRMLS_FETCH();
- utype = UG(unicode)?IS_UNICODE:IS_STRING;
+ utype = IS_UNICODE;
if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) {
if (zend_u_hash_quick_find(&ce->properties_info, hash_key->type, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) {
child_info->flags |= ZEND_ACC_CHANGED;
zstr tmp = zend_u_str_case_fold(Z_TYPE_PP(ns_name), Z_UNIVAL_PP(ns_name), Z_UNILEN_PP(ns_name), 0, &tmp_len);
if (tmp_len != lcname_len ||
- memcmp(tmp.v, lcname.v, UG(unicode)?UBYTES(lcname_len):lcname_len)) {
+ memcmp(tmp.v, lcname.v, UBYTES(lcname_len))) {
zend_error(E_COMPILE_ERROR, "Cannot declare class %R because the name is already in use", Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant));
}
efree(tmp.v);
void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr) /* {{{ */
{
zval *element;
- TSRMLS_FETCH();
ALLOC_ZVAL(element);
*element = expr->u.constant;
case IS_CONSTANT:
/* Ugly hack to denote that this value has a constant index */
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
- if (UG(unicode)) {
- Z_USTRVAL(offset->u.constant) = eurealloc(Z_USTRVAL(offset->u.constant), Z_USTRLEN(offset->u.constant)+3);
- Z_USTRVAL(offset->u.constant)[Z_USTRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant);
- Z_USTRVAL(offset->u.constant)[Z_USTRLEN(offset->u.constant)+2] = 0;
- } else {
- Z_STRVAL(offset->u.constant) = erealloc(Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3);
- Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant);
- Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+2] = 0;
- }
- zend_u_symtable_update(result->u.constant.value.ht, ZEND_STR_TYPE, Z_UNIVAL(offset->u.constant), Z_UNILEN(offset->u.constant)+3, &element, sizeof(zval *), NULL);
+
+ Z_USTRVAL(offset->u.constant) = eurealloc(Z_USTRVAL(offset->u.constant), Z_USTRLEN(offset->u.constant)+3);
+ Z_USTRVAL(offset->u.constant)[Z_USTRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant);
+ Z_USTRVAL(offset->u.constant)[Z_USTRLEN(offset->u.constant)+2] = 0;
+
+ zend_u_symtable_update(result->u.constant.value.ht, IS_UNICODE, Z_UNIVAL(offset->u.constant), Z_UNILEN(offset->u.constant)+3, &element, sizeof(zval *), NULL);
zval_dtor(&offset->u.constant);
break;
case IS_STRING:
zval_dtor(&offset->u.constant);
break;
case IS_NULL:
- zend_u_symtable_update(Z_ARRVAL(result->u.constant), ZEND_STR_TYPE, EMPTY_ZSTR, 1, &element, sizeof(zval *), NULL);
+ zend_u_symtable_update(Z_ARRVAL(result->u.constant), IS_UNICODE, EMPTY_ZSTR, 1, &element, sizeof(zval *), NULL);
break;
case IS_LONG:
case IS_BOOL:
if (varname->op_type == IS_CONST) {
if (Z_TYPE(varname->u.constant) != IS_STRING &&
Z_TYPE(varname->u.constant) != IS_UNICODE) {
- convert_to_text(&varname->u.constant);
+ convert_to_unicode(&varname->u.constant);
}
}
znode value;
if (Z_UNILEN(varname->u.constant) == sizeof("this") - 1 &&
- ZEND_U_EQUAL(UG(unicode)?IS_UNICODE:IS_STRING, Z_UNIVAL(varname->u.constant), Z_UNILEN(varname->u.constant), "this", sizeof("this")-1)) {
+ ZEND_U_EQUAL(IS_UNICODE, Z_UNIVAL(varname->u.constant), Z_UNILEN(varname->u.constant), "this", sizeof("this")-1)) {
zend_error(E_COMPILE_ERROR, "Cannot use $this as lexical variable");
return;
}
if (varname->op_type == IS_CONST) {
if (Z_TYPE(varname->u.constant) != IS_STRING &&
Z_TYPE(varname->u.constant) != IS_UNICODE) {
- convert_to_text(&varname->u.constant);
+ convert_to_unicode(&varname->u.constant);
}
}
if (ZEND_U_EQUAL(Z_TYPE(var->u.constant), Z_UNIVAL(var->u.constant), Z_UNILEN(var->u.constant), "ticks", sizeof("ticks")-1)) {
convert_to_long(&val->u.constant);
CG(declarables).ticks = val->u.constant;
- } else if (UG(unicode) && ZEND_U_EQUAL(Z_TYPE(var->u.constant), Z_UNIVAL(var->u.constant), Z_UNILEN(var->u.constant), "encoding", sizeof("encoding")-1)) {
+ } else if (ZEND_U_EQUAL(Z_TYPE(var->u.constant), Z_UNIVAL(var->u.constant), Z_UNILEN(var->u.constant), "encoding", sizeof("encoding")-1)) {
UErrorCode status = U_ZERO_ERROR;
if ((Z_TYPE(val->u.constant) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
zend_u_hash_init_ex(&ce->properties_info, 0, NULL, (dtor_func_t) (persistent_hashes ? zend_destroy_property_info_internal : zend_destroy_property_info), persistent_hashes, UG(unicode), 0);
zend_u_hash_init_ex(&ce->default_static_members, 0, NULL, zval_ptr_dtor_func, persistent_hashes, UG(unicode), 0);
zend_u_hash_init_ex(&ce->constants_table, 0, NULL, zval_ptr_dtor_func, persistent_hashes, UG(unicode), 0);
- zend_u_hash_init_ex(&ce->function_table, 0, NULL, UG(unicode)?ZEND_U_FUNCTION_DTOR:ZEND_FUNCTION_DTOR, persistent_hashes, UG(unicode), 0);
+ zend_u_hash_init_ex(&ce->function_table, 0, NULL, ZEND_U_FUNCTION_DTOR, persistent_hashes, UG(unicode), 0);
if (ce->type == ZEND_INTERNAL_CLASS) {
#ifdef ZTS
{
zend_op *opline;
- if (!UG(unicode)) {
- *result = *str;
- return;
- }
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_U_NORMALIZE;
opline->result.op_type = IS_TMP_VAR;
{
if (prefix) {
*result = *prefix;
- if (Z_TYPE(result->u.constant) == ZEND_STR_TYPE &&
+ if (Z_TYPE(result->u.constant) == IS_UNICODE &&
Z_UNILEN(result->u.constant) == 0) {
/* namespace\ */
if (CG(current_namespace)) {
}
} else {
result->op_type = IS_CONST;
- Z_TYPE(result->u.constant) = ZEND_STR_TYPE;
+ Z_TYPE(result->u.constant) = IS_UNICODE;
Z_UNIVAL(result->u.constant) = NULL_ZSTR;
Z_UNILEN(result->u.constant) = 0;
}
if (new_name) {
name = &new_name->u.constant;
} else {
+ UChar *p = u_memrchr(Z_USTRVAL_P(ns), '\\', Z_USTRLEN_P(ns));
/* The form "use A\B" is eqivalent to "use A\B as B".
So we extract the last part of compound name to use as a new_name */
name = &tmp;
- if (UG(unicode)) {
- UChar *p = u_memrchr(Z_USTRVAL_P(ns), '\\', Z_USTRLEN_P(ns));
- if (p) {
- ZVAL_UNICODE(name, p+1, 1);
- } else {
- *name = *ns;
- zval_copy_ctor(name);
- warn = !is_global && !CG(current_namespace);
- }
+
+ if (p) {
+ ZVAL_UNICODE(name, p+1, 1);
} else {
- char *p = zend_memrchr(Z_STRVAL_P(ns), '\\', Z_STRLEN_P(ns));
- if (p) {
- ZVAL_STRING(name, p+1, 1);
- } else {
- *name = *ns;
- zval_copy_ctor(name);
- warn = !is_global && !CG(current_namespace);
- }
+ *name = *ns;
+ zval_copy_ctor(name);
+ warn = !is_global && !CG(current_namespace);
}
}
zstr tmp = zend_u_str_case_fold(Z_TYPE_P(ns), Z_UNIVAL_P(ns), Z_UNILEN_P(ns), 0, &tmp_len);
if (tmp_len != ns_name_len + 1 + lcname_len ||
- memcmp(tmp.v, ns_name.v, UG(unicode)?UBYTES(tmp_len):tmp_len)) {
+ memcmp(tmp.v, ns_name.v, UBYTES(tmp_len))) {
zend_error(E_COMPILE_ERROR, "Cannot use %R as %R because the name is already in use", Z_TYPE_P(ns), Z_UNIVAL_P(ns), Z_TYPE_P(name), Z_UNIVAL_P(name));
}
efree(tmp.v);
zstr tmp = zend_u_str_case_fold(Z_TYPE_P(ns), Z_UNIVAL_P(ns), Z_UNILEN_P(ns), 0, &tmp_len);
if (tmp_len != lcname_len ||
- memcmp(tmp.v, lcname.v, UG(unicode)?UBYTES(tmp_len):tmp_len)) {
+ memcmp(tmp.v, lcname.v, UBYTES(tmp_len))) {
zend_error(E_COMPILE_ERROR, "Cannot use %R as %R because the name is already in use", Z_TYPE_P(ns), Z_UNIVAL_P(ns), Z_TYPE_P(name), Z_UNIVAL_P(name));
}
efree(tmp.v);
void copy_zend_constant(zend_constant *c) /* {{{ */
{
TSRMLS_FETCH();
- if (UG(unicode)) {
- c->name.u = zend_ustrndup(c->name.u, c->name_len - 1);
- } else {
- c->name.s = zend_strndup(c->name.s, c->name_len - 1);
- }
+
+ c->name.u = zend_ustrndup(c->name.u, c->name_len - 1);
+
if (!(c->flags & CONST_PERSISTENT)) {
zval_copy_ctor(&c->value);
}
{
zend_constant c;
- if (UG(unicode)) {
- c.name.u = malloc(UBYTES(name_len));
- u_charsToUChars(name, c.name.u, name_len);
- c.name_len = name_len;
- } else {
- c.name.s = zend_strndup(name, name_len-1);
- c.name_len = name_len;
- }
+ c.name.u = malloc(UBYTES(name_len));
+ u_charsToUChars(name, c.name.u, name_len);
+ c.name_len = name_len;
+
Z_TYPE(c.value) = IS_LONG;
Z_LVAL(c.value) = lval;
c.flags = flags;
c.module_number = module_number;
- zend_u_register_constant(ZEND_STR_TYPE, &c TSRMLS_CC);
+ zend_u_register_constant(IS_UNICODE, &c TSRMLS_CC);
}
/* }}} */
{
zend_constant c;
- if (UG(unicode)) {
- c.name.u = malloc(UBYTES(name_len));
- u_charsToUChars(name, c.name.u, name_len);
- c.name_len = name_len;
- } else {
- c.name.s = zend_strndup(name, name_len-1);
- c.name_len = name_len;
- }
+ c.name.u = malloc(UBYTES(name_len));
+ u_charsToUChars(name, c.name.u, name_len);
+ c.name_len = name_len;
+
Z_TYPE(c.value) = IS_DOUBLE;
Z_DVAL(c.value) = dval;
c.flags = flags;
c.module_number = module_number;
- zend_u_register_constant(ZEND_STR_TYPE, &c TSRMLS_CC);
+ zend_u_register_constant(IS_UNICODE, &c TSRMLS_CC);
}
/* }}} */
{
zend_constant c;
- if (UG(unicode)) {
- c.name.u = malloc(UBYTES(name_len));
- u_charsToUChars(name, c.name.u, name_len);
- c.name_len = name_len;
- Z_TYPE(c.value) = IS_UNICODE;
- if (flags & CONST_PERSISTENT) {
- Z_USTRVAL(c.value) = malloc(UBYTES(strlen+1));
- } else {
- Z_USTRVAL(c.value) = emalloc(UBYTES(strlen+1));
- }
- u_charsToUChars(strval, Z_USTRVAL(c.value), strlen+1);
- Z_USTRLEN(c.value) = strlen;
- if (!(flags & CONST_PERSISTENT)) {
- efree(strval);
- }
+ c.name.u = malloc(UBYTES(name_len));
+ u_charsToUChars(name, c.name.u, name_len);
+ c.name_len = name_len;
+ Z_TYPE(c.value) = IS_UNICODE;
+ if (flags & CONST_PERSISTENT) {
+ Z_USTRVAL(c.value) = malloc(UBYTES(strlen+1));
} else {
- c.name.s = zend_strndup(name, name_len-1);
- c.name_len = name_len;
- Z_TYPE(c.value) = IS_STRING;
- Z_STRVAL(c.value) = strval;
- Z_STRLEN(c.value) = strlen;
+ Z_USTRVAL(c.value) = emalloc(UBYTES(strlen+1));
}
+ u_charsToUChars(strval, Z_USTRVAL(c.value), strlen+1);
+ Z_USTRLEN(c.value) = strlen;
+ if (!(flags & CONST_PERSISTENT)) {
+ efree(strval);
+ }
+
c.flags = flags;
c.module_number = module_number;
- zend_u_register_constant(ZEND_STR_TYPE, &c TSRMLS_CC);
+ zend_u_register_constant(IS_UNICODE, &c TSRMLS_CC);
}
/* }}} */
ZEND_API int zend_register_constant(zend_constant *c TSRMLS_DC) /* {{{ */
{
- if (UG(unicode)) {
- UChar *ustr;
-
- if (c->name.s) {
- ustr = malloc(UBYTES(c->name_len));
- u_charsToUChars(c->name.s, ustr, c->name_len);
- free(c->name.s);
- c->name.u = ustr;
- }
- if (Z_TYPE(c->value) == IS_STRING || (Z_TYPE(c->value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
- ustr = pemalloc(UBYTES(Z_STRLEN(c->value)+1), c->flags & CONST_PERSISTENT);
- u_charsToUChars(Z_STRVAL(c->value), ustr, Z_STRLEN(c->value)+1);
- pefree(Z_STRVAL(c->value), c->flags & CONST_PERSISTENT);
- Z_USTRVAL(c->value) = ustr;
- if (Z_TYPE(c->value) == IS_STRING) Z_TYPE(c->value) = IS_UNICODE;
- }
- return zend_u_register_constant(IS_UNICODE, c TSRMLS_CC);
- } else {
- return zend_u_register_constant(IS_STRING, c TSRMLS_CC);
+ UChar *ustr;
+
+ if (c->name.s) {
+ ustr = malloc(UBYTES(c->name_len));
+ u_charsToUChars(c->name.s, ustr, c->name_len);
+ free(c->name.s);
+ c->name.u = ustr;
+ }
+ if (Z_TYPE(c->value) == IS_STRING || (Z_TYPE(c->value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+ ustr = pemalloc(UBYTES(Z_STRLEN(c->value)+1), c->flags & CONST_PERSISTENT);
+ u_charsToUChars(Z_STRVAL(c->value), ustr, Z_STRLEN(c->value)+1);
+ pefree(Z_STRVAL(c->value), c->flags & CONST_PERSISTENT);
+ Z_USTRVAL(c->value) = ustr;
+ if (Z_TYPE(c->value) == IS_STRING) Z_TYPE(c->value) = IS_UNICODE;
}
+ return zend_u_register_constant(IS_UNICODE, c TSRMLS_CC);
}
/* }}} */
zstr class_name;
zend_uint class_name_len;
int dup;
+ zval tmp;
TRACE_APPEND_STR("Object(");
- dup = zend_get_object_classname(*arg, &class_name, &class_name_len TSRMLS_CC);
+ dup = zend_get_object_classname(*arg, &class_name, &class_name_len TSRMLS_CC);
- if (UG(unicode)) {
- zval tmp;
-
- ZVAL_UNICODEL(&tmp, class_name.u, class_name_len, 1);
- convert_to_string_with_converter(&tmp, ZEND_U_CONVERTER(UG(output_encoding_conv)));
- TRACE_APPEND_STRL(Z_STRVAL(tmp), Z_STRLEN(tmp));
- zval_dtor(&tmp);
- } else {
- TRACE_APPEND_STRL(class_name.s, class_name_len);
- }
+ ZVAL_UNICODEL(&tmp, class_name.u, class_name_len, 1);
+ convert_to_string_with_converter(&tmp, ZEND_U_CONVERTER(UG(output_encoding_conv)));
+ TRACE_APPEND_STRL(Z_STRVAL(tmp), Z_STRLEN(tmp));
+ zval_dtor(&tmp);
+
if(!dup) {
efree(class_name.v);
}
static zval **_get_zval_cv_lookup(zval ***ptr, zend_uint var, int type TSRMLS_DC) /* {{{ */
{
zend_compiled_variable *cv = &CV_DEF_OF(var);
- zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar utype = IS_UNICODE;
if (!EG(active_symbol_table) ||
zend_u_hash_quick_find(EG(active_symbol_table), utype, cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
static inline char * zend_verify_arg_class_kind(zend_arg_info *cur_arg_info, ulong fetch_type, zstr *class_name, zend_class_entry **pce TSRMLS_DC) /* {{{ */
{
- *pce = zend_u_fetch_class(UG(unicode) ? IS_UNICODE : IS_STRING, cur_arg_info->class_name, cur_arg_info->class_name_len, (fetch_type | ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
+ *pce = zend_u_fetch_class(IS_UNICODE, cur_arg_info->class_name, cur_arg_info->class_name_len, (fetch_type | ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD) TSRMLS_CC);
*class_name = (*pce) ? (*pce)->name: cur_arg_info->class_name;
if (*pce && (*pce)->ce_flags & ZEND_ACC_INTERFACE) {
static inline int zend_assign_to_string_offset(const temp_variable *T, const zval *value, int value_type TSRMLS_DC) /* {{{ */
{
- if (UG(unicode) && Z_TYPE_P(T->str_offset.str) == IS_STRING && Z_TYPE_P(value) != IS_STRING) {
+ if (Z_TYPE_P(T->str_offset.str) == IS_STRING && Z_TYPE_P(value) != IS_STRING) {
convert_to_unicode(T->str_offset.str);
}
switch (ztype) {
case IS_NULL:
- ztype = ZEND_STR_TYPE;
+ ztype = IS_UNICODE;
offset_key = EMPTY_ZSTR;
offset_key_length = 0;
goto fetch_string_dim;
offset_key_length = Z_UNILEN_P(dim);
fetch_string_dim:
- if (UG(unicode) && ht == &EG(symbol_table) && ztype == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && ztype == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
if (function_name.v) {
return function_name;
- } else if (UG(unicode)) {
- ret.u = u_main;
} else {
- ret.s = "main";
+ ret.u = u_main;
}
return ret;
}
refcount = Z_REFCOUNT_P(p);
is_ref = Z_ISREF_P(p);
- if (!zend_u_get_constant_ex(ZEND_STR_TYPE, Z_UNIVAL_P(p), Z_UNILEN_P(p), &const_value, scope, Z_REAL_TYPE_P(p) TSRMLS_CC)) {
+ if (!zend_u_get_constant_ex(IS_UNICODE, Z_UNIVAL_P(p), Z_UNILEN_P(p), &const_value, scope, Z_REAL_TYPE_P(p) TSRMLS_CC)) {
zstr actual = Z_UNIVAL_P(p);
- if ((UG(unicode) && (colon.u = u_memrchr(Z_USTRVAL_P(p), ':', Z_USTRLEN_P(p))) && colon.u > Z_USTRVAL_P(p) && *(colon.u - 1) == ':') ||
- (!UG(unicode) && (colon.s = zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p))) && colon.s > Z_STRVAL_P(p) && *(colon.s - 1) == ':')
- ) {
+ if ((colon.u = u_memrchr(Z_USTRVAL_P(p), ':', Z_USTRLEN_P(p))) && colon.u > Z_USTRVAL_P(p) && *(colon.u - 1) == ':') {
zend_error(E_ERROR, "Undefined class constant '%v'", actual);
} else {
zstr save = actual, slash;
int actual_len = Z_UNILEN_P(p);
- if(ZEND_STR_TYPE == IS_UNICODE) {
+ if(IS_UNICODE == IS_UNICODE) {
slash.u = u_memrchr(actual.u, '\\', actual_len);
} else {
slash.s = zend_memrchr(actual.s, '\\', actual_len);
}
if ((Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) && slash.v != NULL) {
- if(ZEND_STR_TYPE == IS_UNICODE) {
+ if(IS_UNICODE == IS_UNICODE) {
actual.u = slash.u + 1;
actual_len -= (actual.u - Z_USTRVAL_P(p));
} else {
if (inline_change) {
int type = Z_TYPE_P(p);
- ZVAL_ZSTRL(p, ZEND_STR_TYPE, actual, actual_len, 1);
+ ZVAL_ZSTRL(p, IS_UNICODE, actual, actual_len, 1);
Z_TYPE_P(p) = type;
actual = Z_UNIVAL_P(p);
}
}
- if(ZEND_STR_TYPE == IS_UNICODE && actual.u[0] == '\\') {
+ if(IS_UNICODE == IS_UNICODE && actual.u[0] == '\\') {
if (inline_change) {
memmove(Z_USTRVAL_P(p), Z_USTRVAL_P(p)+1, UBYTES(Z_USTRLEN_P(p)));
--Z_USTRLEN_P(p);
++actual.u;
}
--actual_len;
- } else if(ZEND_STR_TYPE == IS_STRING && actual.s[0] == '\\') {
+ } else if(IS_UNICODE == IS_STRING && actual.s[0] == '\\') {
if (inline_change) {
memmove(Z_STRVAL_P(p), Z_STRVAL_P(p)+1, Z_STRLEN_P(p));
--Z_STRLEN_P(p);
}
if ((Z_TYPE_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
int fix_save = 0;
- if (ZEND_STR_TYPE == IS_UNICODE && save.u[0] == '\\') {
+ if (IS_UNICODE == IS_UNICODE && save.u[0] == '\\') {
save.u++;
fix_save = 1;
- } else if (ZEND_STR_TYPE == IS_STRING && save.s[0] == '\\') {
+ } else if (IS_UNICODE == IS_STRING && save.s[0] == '\\') {
save.s++;
fix_save = 1;
}
zend_error(E_ERROR, "Undefined constant '%v'", save);
if (fix_save) {
- (ZEND_STR_TYPE == IS_UNICODE)?--save.u:--save.s;
+ --save.u;
}
if (inline_change) {
efree(save.v);
efree(save.v);
}
zend_error(E_NOTICE, "Use of undefined constant %v - assumed '%v'", actual, actual);
- Z_TYPE_P(p) = UG(unicode) ? IS_UNICODE : IS_STRING;
+ Z_TYPE_P(p) = IS_UNICODE;
if (!inline_change) {
ZVAL_ZSTRL(p, Z_TYPE_P(p), actual, actual_len, 0);
zval_copy_ctor(p);
continue;
}
Z_TYPE_PP(element) &= ~IS_CONSTANT_INDEX;
- if (zend_hash_get_current_key_ex(Z_ARRVAL_P(p), &str_index, &str_index_len, &num_index, 0, NULL) != (UG(unicode) ? HASH_KEY_IS_UNICODE : HASH_KEY_IS_STRING)) {
+ if (zend_hash_get_current_key_ex(Z_ARRVAL_P(p), &str_index, &str_index_len, &num_index, 0, NULL) != HASH_KEY_IS_UNICODE) {
zend_hash_move_forward(Z_ARRVAL_P(p));
continue;
}
- if (!zend_u_get_constant_ex(ZEND_STR_TYPE, str_index, str_index_len - 3, &const_value, scope, (UG(unicode) ? str_index.u[str_index_len-2] : str_index.s[str_index_len-2]) TSRMLS_CC)) {
- if (UG(unicode)) {
- UChar *actual, *save = str_index.u;
- if ((colon.u = u_memrchr(str_index.u, ':', str_index_len - 3)) && colon.u > str_index.u && *(colon.u-1) == ':') {
- zend_error(E_ERROR, "Undefined class constant '%v'", str_index);
- str_index_len -= ((colon.u - str_index.u) + 1);
- str_index.u = colon.u + 1;
- } else {
- if (str_index.u[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) {
- if ((actual = (UChar *)u_memrchr(str_index.u, '\\', str_index_len - 3))) {
- actual++;
- str_index_len -= (actual - str_index.u);
- str_index.u = actual;
- }
- }
- if (str_index.u[0] == '\\') {
- ++str_index.u;
- --str_index_len;
- }
- if (save[0] == '\\') {
- ++save;
- }
- if ((str_index.u[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) == 0) {
- zend_error(E_ERROR, "Undefined constant '%r'", save);
- }
- }
+ if (!zend_u_get_constant_ex(IS_UNICODE, str_index, str_index_len - 3, &const_value, scope, str_index.u[str_index_len-2] TSRMLS_CC)) {
+ UChar *actual, *save = str_index.u;
+ if ((colon.u = u_memrchr(str_index.u, ':', str_index_len - 3)) && colon.u > str_index.u && *(colon.u-1) == ':') {
+ zend_error(E_ERROR, "Undefined class constant '%v'", str_index);
+ str_index_len -= ((colon.u - str_index.u) + 1);
+ str_index.u = colon.u + 1;
} else {
- char *actual, *save = str_index.s;
- if ((colon.s = zend_memrchr(str_index.s, ':', str_index_len - 3)) && colon.s > str_index.s && *(colon.s-1) == ':') {
- zend_error(E_ERROR, "Undefined class constant '%v'", str_index);
- str_index_len -= ((colon.s - str_index.s) + 1);
- str_index.s = colon.s + 1;
- } else {
- if (str_index.s[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) {
- if ((actual = (char *)zend_memrchr(str_index.s, '\\', str_index_len - 3))) {
- actual++;
- str_index_len -= (actual - str_index.s);
- str_index.s = actual;
- }
- }
- if (str_index.s[0] == '\\') {
- ++str_index.s;
- --str_index_len;
- }
- if (save[0] == '\\') {
- ++save;
- }
- if ((str_index.s[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) == 0) {
- zend_error(E_ERROR, "Undefined constant '%s'", save);
- }
+ if (str_index.u[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) {
+ if ((actual = (UChar *)u_memrchr(str_index.u, '\\', str_index_len - 3))) {
+ actual++;
+ str_index_len -= (actual - str_index.u);
+ str_index.u = actual;
+ }
+ }
+ if (str_index.u[0] == '\\') {
+ ++str_index.u;
+ --str_index_len;
+ }
+ if (save[0] == '\\') {
+ ++save;
+ }
+ if ((str_index.u[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) == 0) {
+ zend_error(E_ERROR, "Undefined constant '%r'", save);
}
}
zend_error(E_NOTICE, "Use of undefined constant %v - assumed '%v'", str_index, str_index);
EG(autoload_func) = fcall_cache.function_handler;
- if (UG(unicode)) {
- zval_dtor(&autoload_function);
- }
+ zval_dtor(&autoload_function);
zval_ptr_dtor(&class_name_ptr);
ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
{
- zend_uchar type = ZEND_STR_TYPE;
+ zend_uchar type = IS_UNICODE;
zend_uint i;
zend_execute_data *ex;
ZEND_API int _zend_ascii_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) /* {{{ */
{
+ zstr key;
+ int ret;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
-
- key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
- ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
- efree(key.u);
- return ret;
- } else {
- return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
- }
+ key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
+ ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int _zend_rt_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
-
- ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, u_len+1, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
}
+
+ ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, u_len+1, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int _zend_utf8_hash_add_or_update(HashTable *ht, const char *arKey, uint nKeyLength, void *pData, uint nDataSize, void **pDest, int flag ZEND_FILE_LINE_DC) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
-
- ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, u_len+1, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return _zend_u_hash_add_or_update(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
}
+
+ ret = _zend_u_hash_add_or_update(ht, IS_UNICODE, key, u_len+1, pData, nDataSize, pDest, flag ZEND_FILE_LINE_CC);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_ascii_hash_del(HashTable *ht, const char *arKey, uint nKeyLength) /* {{{ */
{
+ zstr key;
+ int ret;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
-
- key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
- ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, nKeyLength, 0, HASH_DEL_KEY);
- efree(key.u);
- return ret;
- } else {
- return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, 0, HASH_DEL_KEY);
- }
+ key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
+ ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, nKeyLength, 0, HASH_DEL_KEY);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_rt_hash_del(HashTable *ht, const char *arKey, uint nKeyLength) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
- ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, u_len+1, 0, HASH_DEL_KEY);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, 0, HASH_DEL_KEY);
}
+ ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, u_len+1, 0, HASH_DEL_KEY);
+ efree(key.u);
+ return ret;
+
}
/* }}} */
ZEND_API int zend_utf8_hash_del(HashTable *ht, const char *arKey, uint nKeyLength) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
- ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, u_len+1, 0, HASH_DEL_KEY);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return zend_u_hash_del_key_or_index(ht, IS_STRING, ZSTR(arKey), nKeyLength, 0, HASH_DEL_KEY);
}
+ ret = zend_u_hash_del_key_or_index(ht, IS_UNICODE, key, u_len+1, 0, HASH_DEL_KEY);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_ascii_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData) /* {{{ */
{
+ zstr key;
+ int ret;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
-
- key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
- ret = zend_u_hash_find(ht, IS_UNICODE, key, nKeyLength, pData);
- efree(key.u);
- return ret;
- } else {
- return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData);
- }
+ key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
+ ret = zend_u_hash_find(ht, IS_UNICODE, key, nKeyLength, pData);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_rt_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
- ret = zend_u_hash_find(ht, IS_UNICODE, key, u_len+1, pData);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData);
}
+ ret = zend_u_hash_find(ht, IS_UNICODE, key, u_len+1, pData);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_utf8_hash_find(const HashTable *ht, const char *arKey, uint nKeyLength, void **pData) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
- ret = zend_u_hash_find(ht, IS_UNICODE, key, u_len+1, pData);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return zend_u_hash_find(ht, IS_STRING, ZSTR(arKey), nKeyLength, pData);
}
+ ret = zend_u_hash_find(ht, IS_UNICODE, key, u_len+1, pData);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_ascii_hash_exists(HashTable *ht, const char *arKey, uint nKeyLength) /* {{{ */
{
+ zstr key;
+ int ret;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
-
- key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
- ret = zend_u_hash_exists(ht, IS_UNICODE, key, nKeyLength);
- efree(key.u);
- return ret;
- } else {
- return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength);
- }
+ key.u = zend_ascii_to_unicode(arKey, nKeyLength ZEND_FILE_LINE_CC);
+ ret = zend_u_hash_exists(ht, IS_UNICODE, key, nKeyLength);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_rt_hash_exists(HashTable *ht, const char *arKey, uint nKeyLength) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
- ret = zend_u_hash_exists(ht, IS_UNICODE, key, u_len+1);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength);
- }
+ }
+ ret = zend_u_hash_exists(ht, IS_UNICODE, key, u_len+1);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API int zend_utf8_hash_exists(HashTable *ht, const char *arKey, uint nKeyLength) /* {{{ */
{
+ zstr key;
+ int ret;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
TSRMLS_FETCH();
- if (UG(unicode)) {
- zstr key;
- int ret;
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
- if (U_FAILURE(status)) {
- ZEND_HASH_CVT_ERROR();
- goto string_key;
- }
- ret = zend_u_hash_exists(ht, IS_UNICODE, key, u_len+1);
- efree(key.u);
- return ret;
- } else {
-string_key:
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(utf8_conv)), &key.u, &u_len, arKey, nKeyLength-1, &status);
+ if (U_FAILURE(status)) {
+ ZEND_HASH_CVT_ERROR();
return zend_u_hash_exists(ht, IS_STRING, ZSTR(arKey), nKeyLength);
- }
+ }
+ ret = zend_u_hash_exists(ht, IS_UNICODE, key, u_len+1);
+ efree(key.u);
+ return ret;
}
/* }}} */
ZEND_API ZEND_INI_MH(OnUpdateUTF8String) /* {{{ */
{
UChar **up;
- char **p;
UChar *ustr = NULL;
int32_t ustr_len, capacity;
UErrorCode status = U_ZERO_ERROR;
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
/* Convert only if unicode semantics is on. Otherwise, same as OnUpdateString */
- if (UG(unicode)){
- /* estimate capacity */
- capacity = (new_value_length > 2) ? ((new_value_length >> 1) + (new_value_length >> 3) + 2) : new_value_length;
-
- while (1) {
- ustr = peurealloc(ustr, capacity+1, 1);
- u_strFromUTF8(ustr, capacity+1, &ustr_len, new_value, new_value_length, &status);
- if (status == U_BUFFER_OVERFLOW_ERROR || status == U_STRING_NOT_TERMINATED_WARNING) {
- capacity = ustr_len;
- status = U_ZERO_ERROR;
- } else {
- break;
- }
- }
-
- if (U_FAILURE(status)) {
- zend_error(E_WARNING, "Could not convert UTF-8 INI value to Unicode");
- efree(ustr);
- return FAILURE;
+ /* estimate capacity */
+ capacity = (new_value_length > 2) ? ((new_value_length >> 1) + (new_value_length >> 3) + 2) : new_value_length;
+
+ while (1) {
+ ustr = peurealloc(ustr, capacity+1, 1);
+ u_strFromUTF8(ustr, capacity+1, &ustr_len, new_value, new_value_length, &status);
+ if (status == U_BUFFER_OVERFLOW_ERROR || status == U_STRING_NOT_TERMINATED_WARNING) {
+ capacity = ustr_len;
+ status = U_ZERO_ERROR;
+ } else {
+ break;
}
+ }
- up = (UChar **) (base+(size_t) mh_arg1);
- *up = ustr;
- } else { /* Same as OnUpdateString */
- p = (char **) (base+(size_t) mh_arg1);
- *p = new_value;
+ if (U_FAILURE(status)) {
+ zend_error(E_WARNING, "Could not convert UTF-8 INI value to Unicode");
+ efree(ustr);
+ return FAILURE;
}
+
+ up = (UChar **) (base+(size_t) mh_arg1);
+ *up = ustr;
+
return SUCCESS;
}
/* }}} */
static void zend_ini_get_constant(zval *result, zval *name TSRMLS_DC)
{
zval z_constant;
+ UChar *u_name;
/* in Unicode mode all constants are registered as Unicode */
- if (UG(unicode)) {
- UChar *u_name;
-
- u_name = malloc(UBYTES(Z_STRLEN_P(name) + 1));
- u_charsToUChars(Z_STRVAL_P(name), u_name, Z_STRLEN_P(name) + 1);
-
- /* If name contains ':' it is not a constant. Bug #26893. */
- if (!u_memchr(u_name, ':', Z_STRLEN_P(name))
- && zend_u_get_constant_ex(IS_UNICODE, ZSTR(u_name), Z_STRLEN_P(name), &z_constant, NULL, 0 TSRMLS_CC)) {
- /* z_constant is emalloc()'d */
- convert_to_string(&z_constant);
- Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant));
- Z_STRLEN_P(result) = Z_STRLEN(z_constant);
- Z_TYPE_P(result) = Z_TYPE(z_constant);
- zval_dtor(&z_constant);
- free(Z_STRVAL_P(name));
- } else {
- *result = *name;
- }
- free(u_name);
+ u_name = malloc(UBYTES(Z_STRLEN_P(name) + 1));
+ u_charsToUChars(Z_STRVAL_P(name), u_name, Z_STRLEN_P(name) + 1);
+
+ /* If name contains ':' it is not a constant. Bug #26893. */
+ if (!u_memchr(u_name, ':', Z_STRLEN_P(name))
+ && zend_u_get_constant_ex(IS_UNICODE, ZSTR(u_name), Z_STRLEN_P(name), &z_constant, NULL, 0 TSRMLS_CC)) {
+ /* z_constant is emalloc()'d */
+ convert_to_string(&z_constant);
+ Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant));
+ Z_STRLEN_P(result) = Z_STRLEN(z_constant);
+ Z_TYPE_P(result) = Z_TYPE(z_constant);
+ zval_dtor(&z_constant);
+ free(Z_STRVAL_P(name));
} else {
- /* If name contains ':' it is not a constant. Bug #26893. */
- if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name))
- && zend_get_constant(Z_STRVAL_P(name), Z_STRLEN_P(name), &z_constant TSRMLS_CC)) {
- /* z_constant is emalloc()'d */
- convert_to_string(&z_constant);
- Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant));
- Z_STRLEN_P(result) = Z_STRLEN(z_constant);
- Z_TYPE_P(result) = Z_TYPE(z_constant);
- zval_dtor(&z_constant);
- free(Z_STRVAL_P(name));
- } else {
- *result = *name;
- }
+ *result = *name;
}
+ free(u_name);
}
/* }}} */
| internal_functions_in_yacc { $$ = $1; }
| T_INT_CAST expr { zend_do_cast(&$$, &$2, IS_LONG TSRMLS_CC); }
| T_DOUBLE_CAST expr { zend_do_cast(&$$, &$2, IS_DOUBLE TSRMLS_CC); }
- | T_STRING_CAST expr { zend_do_cast(&$$, &$2, UG(unicode)?IS_UNICODE:IS_STRING TSRMLS_CC); }
+ | T_STRING_CAST expr { zend_do_cast(&$$, &$2, IS_UNICODE TSRMLS_CC); }
| T_UNICODE_CAST expr { zend_do_cast(&$$, &$2, IS_UNICODE TSRMLS_CC); }
| T_BINARY_CAST expr { zend_do_cast(&$$, &$2, IS_STRING TSRMLS_CC); }
| T_ARRAY_CAST expr { zend_do_cast(&$$, &$2, IS_ARRAY TSRMLS_CC); }
| '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; }
| scalar { $$ = $1; }
| T_ARRAY '(' array_pair_list ')' { $$ = $3; }
- | '`' { CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; } backticks_expr '`' { zend_do_shell_exec(&$$, &$3 TSRMLS_CC); }
+ | '`' { CG(literal_type) = IS_UNICODE; } backticks_expr '`' { zend_do_shell_exec(&$$, &$3 TSRMLS_CC); }
| T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); }
| function is_reference '(' { zend_do_begin_lambda_function_declaration(&$$, &$1, $2.op_type, 0 TSRMLS_CC); }
parameter_list ')' lexical_vars '{' inner_statement_list '}' { zend_do_end_function_declaration(&$1 TSRMLS_CC); $$ = $4; }
;
start_heredoc:
- T_START_HEREDOC { CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; $$ = $1; }
+ T_START_HEREDOC { CG(literal_type) = IS_UNICODE; $$ = $1; }
| T_BINARY_HEREDOC { CG(literal_type) = IS_STRING; $$ = $1; }
;
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_TEXT(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_RT, 0 TSRMLS_CC); }
| T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_TEXT(&$$.u.constant); zend_do_build_full_name(NULL, &$$, &$2, 0 TSRMLS_CC); $2 = $$; zend_do_fetch_constant(&$$, NULL, &$2, ZEND_RT, 0 TSRMLS_CC); }
| common_scalar { $$ = $1; }
- | '"' { CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING; } encaps_list '"' { $$ = $3; }
+ | '"' { CG(literal_type) = IS_UNICODE; } encaps_list '"' { $$ = $3; }
| T_BINARY_DOUBLE { CG(literal_type) = IS_STRING; } encaps_list '"' { $$ = $3; }
| start_heredoc encaps_list T_END_HEREDOC { $$ = $2; CG(heredoc) = Z_STRVAL($1.u.constant); CG(heredoc_len) = Z_STRLEN($1.u.constant); }
;
-/* Generated by re2c 0.13.5 on Thu Mar 26 15:38:15 2009 */
+/* Generated by re2c 0.13.5 on Thu Mar 26 16:22:31 2009 */
#line 1 "Zend/zend_language_scanner.l"
/*
+----------------------------------------------------------------------+
n = zend_stream_read(file_handle, buf, len TSRMLS_CC);
}
#endif
-
- /* Don't make any conversions if unicode=off */
- if (!UG(unicode)) {
- return n;
- }
-
/* Autodetect encoding */
if (!SCNG(encoding_checked)) {
int32_t signatureLength;
tmp = *source_string;
zval_copy_ctor(&tmp);
if (Z_TYPE(tmp) != IS_STRING && Z_TYPE(tmp) != IS_UNICODE) {
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
}
source_string = &tmp;
yymore_restart:
-#line 1327 "Zend/zend_language_scanner.c"
+#line 1321 "Zend/zend_language_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
++YYCURSOR;
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 1431 "Zend/zend_language_scanner.c"
+#line 1425 "Zend/zend_language_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2133 "Zend/zend_language_scanner.l"
+#line 2109 "Zend/zend_language_scanner.l"
{
inline_char_handler:
HANDLE_NEWLINES(yytext, yyleng);
return T_INLINE_HTML;
}
-#line 1480 "Zend/zend_language_scanner.c"
+#line 1474 "Zend/zend_language_scanner.c"
yy6:
YYDEBUG(6, *YYCURSOR);
yych = *++YYCURSOR;
yy8:
YYDEBUG(8, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2121 "Zend/zend_language_scanner.l"
+#line 2097 "Zend/zend_language_scanner.l"
{
if (CG(short_tags)) {
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
goto inline_char_handler;
}
}
-#line 1510 "Zend/zend_language_scanner.c"
+#line 1504 "Zend/zend_language_scanner.c"
yy9:
YYDEBUG(9, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy45;
YYDEBUG(10, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2098 "Zend/zend_language_scanner.l"
+#line 2074 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
goto inline_char_handler;
}
}
-#line 1529 "Zend/zend_language_scanner.c"
+#line 1523 "Zend/zend_language_scanner.c"
yy11:
YYDEBUG(11, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(40, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2063 "Zend/zend_language_scanner.l"
+#line 2039 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINES(yytext, yyleng);
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
-#line 1724 "Zend/zend_language_scanner.c"
+#line 1718 "Zend/zend_language_scanner.c"
yy41:
YYDEBUG(41, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(46, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2072 "Zend/zend_language_scanner.l"
+#line 2048 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
goto inline_char_handler;
}
}
-#line 1763 "Zend/zend_language_scanner.c"
+#line 1757 "Zend/zend_language_scanner.c"
yy47:
YYDEBUG(47, *YYCURSOR);
++YYCURSOR;
YYDEBUG(48, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2085 "Zend/zend_language_scanner.l"
+#line 2061 "Zend/zend_language_scanner.l"
{
if (CG(short_tags)) {
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
goto inline_char_handler;
}
}
-#line 1781 "Zend/zend_language_scanner.c"
+#line 1775 "Zend/zend_language_scanner.c"
yy49:
YYDEBUG(49, *YYCURSOR);
yych = *++YYCURSOR;
yy53:
YYDEBUG(53, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2111 "Zend/zend_language_scanner.l"
+#line 2087 "Zend/zend_language_scanner.l"
{
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
Z_STRLEN_P(zendlval) = yyleng;
BEGIN(ST_IN_SCRIPTING);
return T_OPEN_TAG;
}
-#line 1817 "Zend/zend_language_scanner.c"
+#line 1811 "Zend/zend_language_scanner.c"
yy54:
YYDEBUG(54, *YYCURSOR);
++YYCURSOR;
yy58:
YYDEBUG(58, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2552 "Zend/zend_language_scanner.l"
+#line 2518 "Zend/zend_language_scanner.l"
{
if (CG(literal_type) == IS_UNICODE) {
return zend_scan_unicode_escape_string(zendlval, yytext, yyleng, 0x60 /*'`'*/, T_ENCAPSED_AND_WHITESPACE TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
}
-#line 1897 "Zend/zend_language_scanner.c"
+#line 1891 "Zend/zend_language_scanner.c"
yy59:
YYDEBUG(59, *YYCURSOR);
yych = *++YYCURSOR;
yy61:
YYDEBUG(61, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2518 "Zend/zend_language_scanner.l"
+#line 2484 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return T_CURLY_OPEN;
}
-#line 1941 "Zend/zend_language_scanner.c"
+#line 1935 "Zend/zend_language_scanner.c"
yy62:
YYDEBUG(62, *YYCURSOR);
yyaccept = 0;
++YYCURSOR;
YYDEBUG(67, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2649 "Zend/zend_language_scanner.l"
+#line 2615 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '`';
}
-#line 1989 "Zend/zend_language_scanner.c"
+#line 1983 "Zend/zend_language_scanner.c"
yy68:
YYDEBUG(68, *YYCURSOR);
++YYCURSOR;
yy73:
YYDEBUG(73, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2561 "Zend/zend_language_scanner.l"
+#line 2527 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
return T_ENCAPSED_AND_WHITESPACE;
}
}
-#line 2073 "Zend/zend_language_scanner.c"
+#line 2067 "Zend/zend_language_scanner.c"
yy74:
YYDEBUG(74, *YYCURSOR);
yych = *++YYCURSOR;
yy79:
YYDEBUG(79, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2195 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
{
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 2117 "Zend/zend_language_scanner.c"
+#line 2111 "Zend/zend_language_scanner.c"
yy80:
YYDEBUG(80, *YYCURSOR);
++YYCURSOR;
YYDEBUG(81, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1828 "Zend/zend_language_scanner.l"
+#line 1822 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
-#line 2128 "Zend/zend_language_scanner.c"
+#line 2122 "Zend/zend_language_scanner.c"
yy82:
YYDEBUG(82, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(84, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2182 "Zend/zend_language_scanner.l"
+#line 2158 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 2152 "Zend/zend_language_scanner.c"
+#line 2146 "Zend/zend_language_scanner.c"
yy85:
YYDEBUG(85, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2167 "Zend/zend_language_scanner.l"
+#line 2143 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 2183 "Zend/zend_language_scanner.c"
+#line 2177 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_COMMENT:
}
YYDEBUG(91, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2296 "Zend/zend_language_scanner.l"
+#line 2272 "Zend/zend_language_scanner.l"
{
zend_error(E_COMPILE_WARNING, "Unterminated comment starting line %d", CG(zend_lineno));
return 0;
}
-#line 2241 "Zend/zend_language_scanner.c"
+#line 2235 "Zend/zend_language_scanner.c"
yy92:
YYDEBUG(92, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(94, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2307 "Zend/zend_language_scanner.l"
+#line 2283 "Zend/zend_language_scanner.l"
{
yymore();
}
-#line 2257 "Zend/zend_language_scanner.c"
+#line 2251 "Zend/zend_language_scanner.c"
yy95:
YYDEBUG(95, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '/') goto yy97;
YYDEBUG(96, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2330 "Zend/zend_language_scanner.l"
+#line 2306 "Zend/zend_language_scanner.l"
{
yymore();
}
-#line 2268 "Zend/zend_language_scanner.c"
+#line 2262 "Zend/zend_language_scanner.c"
yy97:
YYDEBUG(97, *YYCURSOR);
++YYCURSOR;
YYDEBUG(98, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2324 "Zend/zend_language_scanner.l"
+#line 2300 "Zend/zend_language_scanner.l"
{
HANDLE_NEWLINES(yytext, yyleng);
BEGIN(ST_IN_SCRIPTING);
return T_COMMENT;
}
-#line 2280 "Zend/zend_language_scanner.c"
+#line 2274 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_DOC_COMMENT:
}
YYDEBUG(102, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2296 "Zend/zend_language_scanner.l"
+#line 2272 "Zend/zend_language_scanner.l"
{
zend_error(E_COMPILE_WARNING, "Unterminated comment starting line %d", CG(zend_lineno));
return 0;
}
-#line 2338 "Zend/zend_language_scanner.c"
+#line 2332 "Zend/zend_language_scanner.c"
yy103:
YYDEBUG(103, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(105, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2307 "Zend/zend_language_scanner.l"
+#line 2283 "Zend/zend_language_scanner.l"
{
yymore();
}
-#line 2354 "Zend/zend_language_scanner.c"
+#line 2348 "Zend/zend_language_scanner.c"
yy106:
YYDEBUG(106, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '/') goto yy108;
YYDEBUG(107, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2330 "Zend/zend_language_scanner.l"
+#line 2306 "Zend/zend_language_scanner.l"
{
yymore();
}
-#line 2365 "Zend/zend_language_scanner.c"
+#line 2359 "Zend/zend_language_scanner.c"
yy108:
YYDEBUG(108, *YYCURSOR);
++YYCURSOR;
YYDEBUG(109, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2311 "Zend/zend_language_scanner.l"
+#line 2287 "Zend/zend_language_scanner.l"
{
zval temp;
HANDLE_NEWLINES(yytext, yyleng);
- if (!zend_copy_scanner_string(&temp, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(&temp, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
CG(doc_comment) = temp.value.uni.val;
BEGIN(ST_IN_SCRIPTING);
return T_DOC_COMMENT;
}
-#line 2384 "Zend/zend_language_scanner.c"
+#line 2378 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_DOUBLE_QUOTES:
yy113:
YYDEBUG(113, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2525 "Zend/zend_language_scanner.l"
+#line 2491 "Zend/zend_language_scanner.l"
{
if (CG(literal_type) == IS_UNICODE) {
return zend_scan_unicode_escape_string(zendlval, yytext, yyleng, 0x22 /*'"'*/, T_ENCAPSED_AND_WHITESPACE TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
}
-#line 2459 "Zend/zend_language_scanner.c"
+#line 2453 "Zend/zend_language_scanner.c"
yy114:
YYDEBUG(114, *YYCURSOR);
yych = *++YYCURSOR;
yy116:
YYDEBUG(116, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2518 "Zend/zend_language_scanner.l"
+#line 2484 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return T_CURLY_OPEN;
}
-#line 2504 "Zend/zend_language_scanner.c"
+#line 2498 "Zend/zend_language_scanner.c"
yy117:
YYDEBUG(117, *YYCURSOR);
yyaccept = 0;
++YYCURSOR;
YYDEBUG(122, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2643 "Zend/zend_language_scanner.l"
+#line 2609 "Zend/zend_language_scanner.l"
{
BEGIN(ST_IN_SCRIPTING);
return '"';
}
-#line 2551 "Zend/zend_language_scanner.c"
+#line 2545 "Zend/zend_language_scanner.c"
yy123:
YYDEBUG(123, *YYCURSOR);
++YYCURSOR;
yy128:
YYDEBUG(128, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2540 "Zend/zend_language_scanner.l"
+#line 2506 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
return T_ENCAPSED_AND_WHITESPACE;
}
}
-#line 2638 "Zend/zend_language_scanner.c"
+#line 2632 "Zend/zend_language_scanner.c"
yy129:
YYDEBUG(129, *YYCURSOR);
yych = *++YYCURSOR;
yy134:
YYDEBUG(134, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2195 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
{
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 2682 "Zend/zend_language_scanner.c"
+#line 2676 "Zend/zend_language_scanner.c"
yy135:
YYDEBUG(135, *YYCURSOR);
++YYCURSOR;
YYDEBUG(136, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1828 "Zend/zend_language_scanner.l"
+#line 1822 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
-#line 2693 "Zend/zend_language_scanner.c"
+#line 2687 "Zend/zend_language_scanner.c"
yy137:
YYDEBUG(137, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(139, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2182 "Zend/zend_language_scanner.l"
+#line 2158 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 2717 "Zend/zend_language_scanner.c"
+#line 2711 "Zend/zend_language_scanner.c"
yy140:
YYDEBUG(140, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(142, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2167 "Zend/zend_language_scanner.l"
+#line 2143 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 2748 "Zend/zend_language_scanner.c"
+#line 2742 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_END_HEREDOC:
++YYCURSOR;
YYDEBUG(146, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 2762 "Zend/zend_language_scanner.c"
+#line 2756 "Zend/zend_language_scanner.c"
yy147:
YYDEBUG(147, *YYCURSOR);
++YYCURSOR;
YYDEBUG(148, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2504 "Zend/zend_language_scanner.l"
+#line 2470 "Zend/zend_language_scanner.l"
{
YYCURSOR += CG(heredoc_len) - 1;
yyleng = CG(heredoc_len);
BEGIN(ST_IN_SCRIPTING);
return T_END_HEREDOC;
}
-#line 2780 "Zend/zend_language_scanner.c"
+#line 2774 "Zend/zend_language_scanner.c"
/* *********************************** */
yyc_ST_HEREDOC:
{
yy151:
YYDEBUG(151, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2580 "Zend/zend_language_scanner.l"
+#line 2546 "Zend/zend_language_scanner.l"
{
if (CG(literal_type) == IS_UNICODE) {
return zend_scan_unicode_escape_string(zendlval, yytext, yyleng, 0, T_ENCAPSED_AND_WHITESPACE TSRMLS_CC);
return T_ENCAPSED_AND_WHITESPACE;
}
}
-#line 2859 "Zend/zend_language_scanner.c"
+#line 2853 "Zend/zend_language_scanner.c"
yy152:
YYDEBUG(152, *YYCURSOR);
yyaccept = 0;
yy155:
YYDEBUG(155, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2518 "Zend/zend_language_scanner.l"
+#line 2484 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = (long) '{';
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return T_CURLY_OPEN;
}
-#line 2916 "Zend/zend_language_scanner.c"
+#line 2910 "Zend/zend_language_scanner.c"
yy156:
YYDEBUG(156, *YYCURSOR);
yyaccept = 0;
yy174:
YYDEBUG(174, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2589 "Zend/zend_language_scanner.l"
+#line 2555 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
return T_ENCAPSED_AND_WHITESPACE;
}
}
-#line 3178 "Zend/zend_language_scanner.c"
+#line 3172 "Zend/zend_language_scanner.c"
yy175:
YYDEBUG(175, *YYCURSOR);
yyaccept = 2;
++YYCURSOR;
YYDEBUG(182, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2462 "Zend/zend_language_scanner.l"
+#line 2428 "Zend/zend_language_scanner.l"
{
char *end = yytext + yyleng - 1;
yymore();
}
}
-#line 3319 "Zend/zend_language_scanner.c"
+#line 3313 "Zend/zend_language_scanner.c"
yy183:
YYDEBUG(183, *YYCURSOR);
yyaccept = 2;
yy204:
YYDEBUG(204, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2195 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
{
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 3589 "Zend/zend_language_scanner.c"
+#line 3583 "Zend/zend_language_scanner.c"
yy205:
YYDEBUG(205, *YYCURSOR);
++YYCURSOR;
YYDEBUG(206, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1828 "Zend/zend_language_scanner.l"
+#line 1822 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
return T_DOLLAR_OPEN_CURLY_BRACES;
}
-#line 3600 "Zend/zend_language_scanner.c"
+#line 3594 "Zend/zend_language_scanner.c"
yy207:
YYDEBUG(207, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(209, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2182 "Zend/zend_language_scanner.l"
+#line 2158 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 3624 "Zend/zend_language_scanner.c"
+#line 3618 "Zend/zend_language_scanner.c"
yy210:
YYDEBUG(210, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(212, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2167 "Zend/zend_language_scanner.l"
+#line 2143 "Zend/zend_language_scanner.l"
{
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 3655 "Zend/zend_language_scanner.c"
+#line 3649 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_IN_SCRIPTING:
++YYCURSOR;
YYDEBUG(216, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 3855 "Zend/zend_language_scanner.c"
+#line 3849 "Zend/zend_language_scanner.c"
yy217:
YYDEBUG(217, *YYCURSOR);
++YYCURSOR;
yy218:
YYDEBUG(218, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2223 "Zend/zend_language_scanner.l"
+#line 2199 "Zend/zend_language_scanner.l"
{
- if (!zend_copy_scanner_string(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_STRING;
}
-#line 3888 "Zend/zend_language_scanner.c"
+#line 3882 "Zend/zend_language_scanner.c"
yy219:
YYDEBUG(219, *YYCURSOR);
yych = *++YYCURSOR;
yy232:
YYDEBUG(232, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1817 "Zend/zend_language_scanner.l"
+#line 1811 "Zend/zend_language_scanner.l"
{
return yytext[0];
}
-#line 4139 "Zend/zend_language_scanner.c"
+#line 4133 "Zend/zend_language_scanner.c"
yy233:
YYDEBUG(233, *YYCURSOR);
++YYCURSOR;
yy234:
YYDEBUG(234, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1544 "Zend/zend_language_scanner.l"
+#line 1538 "Zend/zend_language_scanner.l"
{
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
Z_STRLEN_P(zendlval) = yyleng;
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
-#line 4156 "Zend/zend_language_scanner.c"
+#line 4150 "Zend/zend_language_scanner.c"
yy235:
YYDEBUG(235, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(237, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1577 "Zend/zend_language_scanner.l"
+#line 1571 "Zend/zend_language_scanner.l"
{
return T_NS_SEPARATOR;
}
-#line 4171 "Zend/zend_language_scanner.c"
+#line 4165 "Zend/zend_language_scanner.c"
yy238:
YYDEBUG(238, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(262, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1822 "Zend/zend_language_scanner.l"
+#line 1816 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return '{';
}
-#line 4404 "Zend/zend_language_scanner.c"
+#line 4398 "Zend/zend_language_scanner.c"
yy263:
YYDEBUG(263, *YYCURSOR);
++YYCURSOR;
YYDEBUG(264, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1834 "Zend/zend_language_scanner.l"
+#line 1828 "Zend/zend_language_scanner.l"
{
RESET_DOC_COMMENT();
if (!zend_stack_is_empty(&SCNG(state_stack))) {
}
return '}';
}
-#line 4418 "Zend/zend_language_scanner.c"
+#line 4412 "Zend/zend_language_scanner.c"
yy265:
YYDEBUG(265, *YYCURSOR);
yyaccept = 2;
yy266:
YYDEBUG(266, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1864 "Zend/zend_language_scanner.l"
+#line 1858 "Zend/zend_language_scanner.l"
{
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
Z_LVAL_P(zendlval) = strtol(yytext, NULL, 0);
Z_TYPE_P(zendlval) = IS_LONG;
return T_LNUMBER;
}
-#line 4462 "Zend/zend_language_scanner.c"
+#line 4456 "Zend/zend_language_scanner.c"
yy267:
YYDEBUG(267, *YYCURSOR);
yyaccept = 2;
yy270:
YYDEBUG(270, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2241 "Zend/zend_language_scanner.l"
+#line 2217 "Zend/zend_language_scanner.l"
{
BEGIN(ST_ONE_LINE_COMMENT);
yymore();
}
-#line 4495 "Zend/zend_language_scanner.c"
+#line 4489 "Zend/zend_language_scanner.c"
yy271:
YYDEBUG(271, *YYCURSOR);
yyaccept = 3;
yy272:
YYDEBUG(272, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2391 "Zend/zend_language_scanner.l"
+#line 2357 "Zend/zend_language_scanner.l"
{
BEGIN(ST_DOUBLE_QUOTES);
return '"';
}
-#line 4509 "Zend/zend_language_scanner.c"
+#line 4503 "Zend/zend_language_scanner.c"
yy273:
YYDEBUG(273, *YYCURSOR);
yyaccept = 4;
yy274:
YYDEBUG(274, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2656 "Zend/zend_language_scanner.l"
+#line 2622 "Zend/zend_language_scanner.l"
{
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
goto restart;
}
-#line 4523 "Zend/zend_language_scanner.c"
+#line 4517 "Zend/zend_language_scanner.c"
yy275:
YYDEBUG(275, *YYCURSOR);
++YYCURSOR;
YYDEBUG(276, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2450 "Zend/zend_language_scanner.l"
+#line 2416 "Zend/zend_language_scanner.l"
{
BEGIN(ST_BACKQUOTE);
return '`';
}
-#line 4534 "Zend/zend_language_scanner.c"
+#line 4528 "Zend/zend_language_scanner.c"
yy277:
YYDEBUG(277, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(283, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2375 "Zend/zend_language_scanner.l"
+#line 2346 "Zend/zend_language_scanner.l"
{
- if (UG(unicode)) {
- return zend_scan_unicode_single_string(zendlval TSRMLS_CC);
- } else {
- zend_scan_binary_single_string(zendlval, yytext+1, yyleng-2 TSRMLS_CC);
- return T_CONSTANT_ENCAPSED_STRING;
- }
+ return zend_scan_unicode_single_string(zendlval TSRMLS_CC);
}
-#line 4605 "Zend/zend_language_scanner.c"
+#line 4594 "Zend/zend_language_scanner.c"
yy284:
YYDEBUG(284, *YYCURSOR);
++YYCURSOR;
++YYCURSOR;
YYDEBUG(292, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2359 "Zend/zend_language_scanner.l"
+#line 2335 "Zend/zend_language_scanner.l"
{
- if (UG(unicode)) {
- return zend_scan_unicode_escape_string(zendlval, yytext+1, yyleng-2, 0x22 /*'"'*/, T_CONSTANT_ENCAPSED_STRING TSRMLS_CC);
- } else {
- zend_scan_binary_escape_string(zendlval, yytext+1, yyleng-2, '"' TSRMLS_CC);
- return T_CONSTANT_ENCAPSED_STRING;
- }
+ return zend_scan_unicode_escape_string(zendlval, yytext+1, yyleng-2, 0x22 /*'"'*/, T_CONSTANT_ENCAPSED_STRING TSRMLS_CC);
}
-#line 4680 "Zend/zend_language_scanner.c"
+#line 4664 "Zend/zend_language_scanner.c"
yy293:
YYDEBUG(293, *YYCURSOR);
++YYCURSOR;
yy298:
YYDEBUG(298, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1925 "Zend/zend_language_scanner.l"
+#line 1919 "Zend/zend_language_scanner.l"
{
Z_DVAL_P(zendlval) = zend_strtod(yytext, NULL);
Z_TYPE_P(zendlval) = IS_DOUBLE;
return T_DNUMBER;
}
-#line 4720 "Zend/zend_language_scanner.c"
+#line 4704 "Zend/zend_language_scanner.c"
yy299:
YYDEBUG(299, *YYCURSOR);
yyaccept = 2;
}
YYDEBUG(308, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1885 "Zend/zend_language_scanner.l"
+#line 1879 "Zend/zend_language_scanner.l"
{
char *hex = yytext + 2; /* Skip "0x" */
int len = yyleng - 2;
return T_DNUMBER;
}
}
-#line 4803 "Zend/zend_language_scanner.c"
+#line 4787 "Zend/zend_language_scanner.c"
yy309:
YYDEBUG(309, *YYCURSOR);
++YYCURSOR;
yy310:
YYDEBUG(310, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2334 "Zend/zend_language_scanner.l"
+#line 2310 "Zend/zend_language_scanner.l"
{
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
Z_STRLEN_P(zendlval) = yyleng;
BEGIN(INITIAL);
return T_CLOSE_TAG; /* implicit ';' at php-end tag */
}
-#line 4820 "Zend/zend_language_scanner.c"
+#line 4804 "Zend/zend_language_scanner.c"
yy311:
YYDEBUG(311, *YYCURSOR);
yych = *++YYCURSOR;
yy315:
YYDEBUG(315, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2195 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
{
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 4864 "Zend/zend_language_scanner.c"
+#line 4848 "Zend/zend_language_scanner.c"
yy316:
YYDEBUG(316, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(318, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1805 "Zend/zend_language_scanner.l"
+#line 1799 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_XOR;
}
-#line 4882 "Zend/zend_language_scanner.c"
+#line 4866 "Zend/zend_language_scanner.c"
yy319:
YYDEBUG(319, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(320, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1797 "Zend/zend_language_scanner.l"
+#line 1791 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_OR;
}
-#line 4895 "Zend/zend_language_scanner.c"
+#line 4879 "Zend/zend_language_scanner.c"
yy321:
YYDEBUG(321, *YYCURSOR);
++YYCURSOR;
YYDEBUG(322, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1785 "Zend/zend_language_scanner.l"
+#line 1779 "Zend/zend_language_scanner.l"
{
return T_XOR_EQUAL;
}
-#line 4905 "Zend/zend_language_scanner.c"
+#line 4889 "Zend/zend_language_scanner.c"
yy323:
YYDEBUG(323, *YYCURSOR);
++YYCURSOR;
YYDEBUG(324, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1789 "Zend/zend_language_scanner.l"
+#line 1783 "Zend/zend_language_scanner.l"
{
return T_BOOLEAN_OR;
}
-#line 4915 "Zend/zend_language_scanner.c"
+#line 4899 "Zend/zend_language_scanner.c"
yy325:
YYDEBUG(325, *YYCURSOR);
++YYCURSOR;
YYDEBUG(326, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1781 "Zend/zend_language_scanner.l"
+#line 1775 "Zend/zend_language_scanner.l"
{
return T_OR_EQUAL;
}
-#line 4925 "Zend/zend_language_scanner.c"
+#line 4909 "Zend/zend_language_scanner.c"
yy327:
YYDEBUG(327, *YYCURSOR);
++YYCURSOR;
YYDEBUG(328, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1793 "Zend/zend_language_scanner.l"
+#line 1787 "Zend/zend_language_scanner.l"
{
return T_BOOLEAN_AND;
}
-#line 4935 "Zend/zend_language_scanner.c"
+#line 4919 "Zend/zend_language_scanner.c"
yy329:
YYDEBUG(329, *YYCURSOR);
++YYCURSOR;
YYDEBUG(330, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1777 "Zend/zend_language_scanner.l"
+#line 1771 "Zend/zend_language_scanner.l"
{
return T_AND_EQUAL;
}
-#line 4945 "Zend/zend_language_scanner.c"
+#line 4929 "Zend/zend_language_scanner.c"
yy331:
YYDEBUG(331, *YYCURSOR);
++YYCURSOR;
yy332:
YYDEBUG(332, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2343 "Zend/zend_language_scanner.l"
+#line 2319 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags)) {
BEGIN(INITIAL);
return yytext[0];
}
}
-#line 4967 "Zend/zend_language_scanner.c"
+#line 4951 "Zend/zend_language_scanner.c"
yy333:
YYDEBUG(333, *YYCURSOR);
++YYCURSOR;
YYDEBUG(334, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1765 "Zend/zend_language_scanner.l"
+#line 1759 "Zend/zend_language_scanner.l"
{
return T_MOD_EQUAL;
}
-#line 4977 "Zend/zend_language_scanner.c"
+#line 4961 "Zend/zend_language_scanner.c"
yy335:
YYDEBUG(335, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(340, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1761 "Zend/zend_language_scanner.l"
+#line 1755 "Zend/zend_language_scanner.l"
{
return T_CONCAT_EQUAL;
}
-#line 5012 "Zend/zend_language_scanner.c"
+#line 4996 "Zend/zend_language_scanner.c"
yy341:
YYDEBUG(341, *YYCURSOR);
yyaccept = 6;
yy342:
YYDEBUG(342, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2301 "Zend/zend_language_scanner.l"
+#line 2277 "Zend/zend_language_scanner.l"
{
BEGIN(ST_COMMENT);
yymore();
}
-#line 5026 "Zend/zend_language_scanner.c"
+#line 5010 "Zend/zend_language_scanner.c"
yy343:
YYDEBUG(343, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(345, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1757 "Zend/zend_language_scanner.l"
+#line 1751 "Zend/zend_language_scanner.l"
{
return T_DIV_EQUAL;
}
-#line 5040 "Zend/zend_language_scanner.c"
+#line 5024 "Zend/zend_language_scanner.c"
yy346:
YYDEBUG(346, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(349, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2290 "Zend/zend_language_scanner.l"
+#line 2266 "Zend/zend_language_scanner.l"
{
RESET_DOC_COMMENT();
BEGIN(ST_DOC_COMMENT);
yymore();
}
-#line 5065 "Zend/zend_language_scanner.c"
+#line 5049 "Zend/zend_language_scanner.c"
yy350:
YYDEBUG(350, *YYCURSOR);
++YYCURSOR;
YYDEBUG(351, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1753 "Zend/zend_language_scanner.l"
+#line 1747 "Zend/zend_language_scanner.l"
{
return T_MUL_EQUAL;
}
-#line 5075 "Zend/zend_language_scanner.c"
+#line 5059 "Zend/zend_language_scanner.c"
yy352:
YYDEBUG(352, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy356;
YYDEBUG(353, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1813 "Zend/zend_language_scanner.l"
+#line 1807 "Zend/zend_language_scanner.l"
{
return T_SR;
}
-#line 5086 "Zend/zend_language_scanner.c"
+#line 5070 "Zend/zend_language_scanner.c"
yy354:
YYDEBUG(354, *YYCURSOR);
++YYCURSOR;
YYDEBUG(355, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1741 "Zend/zend_language_scanner.l"
+#line 1735 "Zend/zend_language_scanner.l"
{
return T_IS_GREATER_OR_EQUAL;
}
-#line 5096 "Zend/zend_language_scanner.c"
+#line 5080 "Zend/zend_language_scanner.c"
yy356:
YYDEBUG(356, *YYCURSOR);
++YYCURSOR;
YYDEBUG(357, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1773 "Zend/zend_language_scanner.l"
+#line 1767 "Zend/zend_language_scanner.l"
{
return T_SR_EQUAL;
}
-#line 5106 "Zend/zend_language_scanner.c"
+#line 5090 "Zend/zend_language_scanner.c"
yy358:
YYDEBUG(358, *YYCURSOR);
yyaccept = 7;
yy359:
YYDEBUG(359, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1809 "Zend/zend_language_scanner.l"
+#line 1803 "Zend/zend_language_scanner.l"
{
return T_SL;
}
-#line 5121 "Zend/zend_language_scanner.c"
+#line 5105 "Zend/zend_language_scanner.c"
yy360:
YYDEBUG(360, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(362, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1737 "Zend/zend_language_scanner.l"
+#line 1731 "Zend/zend_language_scanner.l"
{
return T_IS_SMALLER_OR_EQUAL;
}
-#line 5137 "Zend/zend_language_scanner.c"
+#line 5121 "Zend/zend_language_scanner.c"
yy363:
YYDEBUG(363, *YYCURSOR);
++YYCURSOR;
yy364:
YYDEBUG(364, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1733 "Zend/zend_language_scanner.l"
+#line 1727 "Zend/zend_language_scanner.l"
{
return T_IS_NOT_EQUAL;
}
-#line 5148 "Zend/zend_language_scanner.c"
+#line 5132 "Zend/zend_language_scanner.c"
yy365:
YYDEBUG(365, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(373, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1769 "Zend/zend_language_scanner.l"
+#line 1763 "Zend/zend_language_scanner.l"
{
return T_SL_EQUAL;
}
-#line 5203 "Zend/zend_language_scanner.c"
+#line 5187 "Zend/zend_language_scanner.c"
yy374:
YYDEBUG(374, *YYCURSOR);
++YYCURSOR;
yy384:
YYDEBUG(384, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2401 "Zend/zend_language_scanner.l"
+#line 2367 "Zend/zend_language_scanner.l"
{
char *s;
int bprefix = (yytext[0] != '<') ? 1 : 0;
return bprefix ? T_BINARY_HEREDOC : T_START_HEREDOC;
}
-#line 5356 "Zend/zend_language_scanner.c"
+#line 5340 "Zend/zend_language_scanner.c"
yy385:
YYDEBUG(385, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(390, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1725 "Zend/zend_language_scanner.l"
+#line 1719 "Zend/zend_language_scanner.l"
{
return T_IS_NOT_IDENTICAL;
}
-#line 5400 "Zend/zend_language_scanner.c"
+#line 5384 "Zend/zend_language_scanner.c"
yy391:
YYDEBUG(391, *YYCURSOR);
++YYCURSOR;
YYDEBUG(392, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1745 "Zend/zend_language_scanner.l"
+#line 1739 "Zend/zend_language_scanner.l"
{
return T_PLUS_EQUAL;
}
-#line 5410 "Zend/zend_language_scanner.c"
+#line 5394 "Zend/zend_language_scanner.c"
yy393:
YYDEBUG(393, *YYCURSOR);
++YYCURSOR;
YYDEBUG(394, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1713 "Zend/zend_language_scanner.l"
+#line 1707 "Zend/zend_language_scanner.l"
{
return T_INC;
}
-#line 5420 "Zend/zend_language_scanner.c"
+#line 5404 "Zend/zend_language_scanner.c"
yy395:
YYDEBUG(395, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(398, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1705 "Zend/zend_language_scanner.l"
+#line 1699 "Zend/zend_language_scanner.l"
{
return T_LIST;
}
-#line 5443 "Zend/zend_language_scanner.c"
+#line 5427 "Zend/zend_language_scanner.c"
yy399:
YYDEBUG(399, *YYCURSOR);
++YYCURSOR;
if ((yych = *YYCURSOR) == '=') goto yy403;
YYDEBUG(400, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1729 "Zend/zend_language_scanner.l"
+#line 1723 "Zend/zend_language_scanner.l"
{
return T_IS_EQUAL;
}
-#line 5454 "Zend/zend_language_scanner.c"
+#line 5438 "Zend/zend_language_scanner.c"
yy401:
YYDEBUG(401, *YYCURSOR);
++YYCURSOR;
YYDEBUG(402, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1701 "Zend/zend_language_scanner.l"
+#line 1695 "Zend/zend_language_scanner.l"
{
return T_DOUBLE_ARROW;
}
-#line 5464 "Zend/zend_language_scanner.c"
+#line 5448 "Zend/zend_language_scanner.c"
yy403:
YYDEBUG(403, *YYCURSOR);
++YYCURSOR;
YYDEBUG(404, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1721 "Zend/zend_language_scanner.l"
+#line 1715 "Zend/zend_language_scanner.l"
{
return T_IS_IDENTICAL;
}
-#line 5474 "Zend/zend_language_scanner.c"
+#line 5458 "Zend/zend_language_scanner.c"
yy405:
YYDEBUG(405, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(423, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2053 "Zend/zend_language_scanner.l"
+#line 2029 "Zend/zend_language_scanner.l"
{
if (CG(current_namespace)) {
*zendlval = *CG(current_namespace);
}
return T_NS_C;
}
-#line 5606 "Zend/zend_language_scanner.c"
+#line 5590 "Zend/zend_language_scanner.c"
yy424:
YYDEBUG(424, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(428, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2026 "Zend/zend_language_scanner.l"
+#line 2002 "Zend/zend_language_scanner.l"
{
char *filename = zend_get_compiled_filename(TSRMLS_C);
const size_t filename_len = strlen(filename);
zendlval->type = IS_STRING;
return T_DIR;
}
-#line 5653 "Zend/zend_language_scanner.c"
+#line 5637 "Zend/zend_language_scanner.c"
yy429:
YYDEBUG(429, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(434, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2010 "Zend/zend_language_scanner.l"
+#line 1986 "Zend/zend_language_scanner.l"
{
Z_LVAL_P(zendlval) = CG(zend_lineno);
Z_TYPE_P(zendlval) = IS_LONG;
return T_LINE;
}
-#line 5684 "Zend/zend_language_scanner.c"
+#line 5668 "Zend/zend_language_scanner.c"
yy435:
YYDEBUG(435, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(442, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1961 "Zend/zend_language_scanner.l"
+#line 1955 "Zend/zend_language_scanner.l"
{
zstr class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL_ZSTR;
zstr func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL_ZSTR;
size_t len = 0;
+ size_t len1;
- if (UG(unicode)) {
- size_t len1;
-
- if (class_name.u) {
- len += len1 = u_strlen(class_name.u);
- len += 2;
- }
- if (func_name.u) {
- len += u_strlen(func_name.u);
- } else {
- func_name.u = EMPTY_STR;
- }
- Z_USTRLEN_P(zendlval) = len;
- Z_USTRVAL_P(zendlval) = eumalloc(len+1);
- if (class_name.u) {
- u_strcpy(Z_USTRVAL_P(zendlval), class_name.u);
- Z_USTRVAL_P(zendlval)[len1] = 0x3a; /* ':' */
- Z_USTRVAL_P(zendlval)[len1+1] = 0x3a; /* ':' */
- Z_USTRVAL_P(zendlval)[len1+2] = 0;
- } else {
- Z_USTRVAL_P(zendlval)[0] = 0;
- }
- u_strcat(Z_USTRVAL_P(zendlval), func_name.u);
- Z_TYPE_P(zendlval) = IS_UNICODE;
+ if (class_name.u) {
+ len += len1 = u_strlen(class_name.u);
+ len += 2;
+ }
+ if (func_name.u) {
+ len += u_strlen(func_name.u);
} else {
- if (class_name.s) {
- len += strlen(class_name.s) + 2;
- }
- if (func_name.s) {
- len += strlen(func_name.s);
- }
-
- Z_STRVAL_P(zendlval) = emalloc(len+1);
- Z_STRLEN_P(zendlval) = sprintf(Z_STRVAL_P(zendlval), "%s%s%s",
- class_name.s ? class_name.s : "",
- class_name.s && func_name.s ? "::" : "",
- func_name.s ? func_name.s : ""
- );
- Z_STRLEN_P(zendlval) = strlen(Z_STRVAL_P(zendlval));
- Z_TYPE_P(zendlval) = IS_STRING;
+ func_name.u = EMPTY_STR;
}
+ Z_USTRLEN_P(zendlval) = len;
+ Z_USTRVAL_P(zendlval) = eumalloc(len+1);
+ if (class_name.u) {
+ u_strcpy(Z_USTRVAL_P(zendlval), class_name.u);
+ Z_USTRVAL_P(zendlval)[len1] = 0x3a; /* ':' */
+ Z_USTRVAL_P(zendlval)[len1+1] = 0x3a; /* ':' */
+ Z_USTRVAL_P(zendlval)[len1+2] = 0;
+ } else {
+ Z_USTRVAL_P(zendlval)[0] = 0;
+ }
+ u_strcat(Z_USTRVAL_P(zendlval), func_name.u);
+ Z_TYPE_P(zendlval) = IS_UNICODE;
+
return T_METHOD_C;
}
-#line 5768 "Zend/zend_language_scanner.c"
+#line 5734 "Zend/zend_language_scanner.c"
yy443:
YYDEBUG(443, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(453, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1946 "Zend/zend_language_scanner.l"
+#line 1940 "Zend/zend_language_scanner.l"
{
zstr func_name = NULL_ZSTR;
}
return T_FUNC_C;
}
-#line 5834 "Zend/zend_language_scanner.c"
+#line 5800 "Zend/zend_language_scanner.c"
yy454:
YYDEBUG(454, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(458, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2016 "Zend/zend_language_scanner.l"
+#line 1992 "Zend/zend_language_scanner.l"
{
char *filename = zend_get_compiled_filename(TSRMLS_C);
ZVAL_RT_STRING(zendlval, filename, 1);
return T_FILE;
}
-#line 5864 "Zend/zend_language_scanner.c"
+#line 5830 "Zend/zend_language_scanner.c"
yy459:
YYDEBUG(459, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(465, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1931 "Zend/zend_language_scanner.l"
+#line 1925 "Zend/zend_language_scanner.l"
{
zstr class_name = NULL_ZSTR;
}
return T_CLASS_C;
}
-#line 5909 "Zend/zend_language_scanner.c"
+#line 5875 "Zend/zend_language_scanner.c"
yy466:
YYDEBUG(466, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(478, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1669 "Zend/zend_language_scanner.l"
+#line 1663 "Zend/zend_language_scanner.l"
{
return T_HALT_COMPILER;
}
-#line 5975 "Zend/zend_language_scanner.c"
+#line 5941 "Zend/zend_language_scanner.c"
yy479:
YYDEBUG(479, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(482, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1653 "Zend/zend_language_scanner.l"
+#line 1647 "Zend/zend_language_scanner.l"
{
return T_USE;
}
-#line 5999 "Zend/zend_language_scanner.c"
+#line 5965 "Zend/zend_language_scanner.c"
yy483:
YYDEBUG(483, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(486, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1697 "Zend/zend_language_scanner.l"
+#line 1691 "Zend/zend_language_scanner.l"
{
return T_UNSET;
}
-#line 6022 "Zend/zend_language_scanner.c"
+#line 5988 "Zend/zend_language_scanner.c"
yy487:
YYDEBUG(487, *YYCURSOR);
++YYCURSOR;
++YYCURSOR;
YYDEBUG(504, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1593 "Zend/zend_language_scanner.l"
+#line 1587 "Zend/zend_language_scanner.l"
{
return T_INT_CAST;
}
-#line 6198 "Zend/zend_language_scanner.c"
+#line 6164 "Zend/zend_language_scanner.c"
yy505:
YYDEBUG(505, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(513, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1597 "Zend/zend_language_scanner.l"
+#line 1591 "Zend/zend_language_scanner.l"
{
return T_DOUBLE_CAST;
}
-#line 6246 "Zend/zend_language_scanner.c"
+#line 6212 "Zend/zend_language_scanner.c"
yy514:
YYDEBUG(514, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(527, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1601 "Zend/zend_language_scanner.l"
+#line 1595 "Zend/zend_language_scanner.l"
{
return T_STRING_CAST;
}
-#line 6320 "Zend/zend_language_scanner.c"
+#line 6286 "Zend/zend_language_scanner.c"
yy528:
YYDEBUG(528, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(534, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1613 "Zend/zend_language_scanner.l"
+#line 1607 "Zend/zend_language_scanner.l"
{
return T_ARRAY_CAST;
}
-#line 6357 "Zend/zend_language_scanner.c"
+#line 6323 "Zend/zend_language_scanner.c"
yy535:
YYDEBUG(535, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(542, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1617 "Zend/zend_language_scanner.l"
+#line 1611 "Zend/zend_language_scanner.l"
{
return T_OBJECT_CAST;
}
-#line 6399 "Zend/zend_language_scanner.c"
+#line 6365 "Zend/zend_language_scanner.c"
yy543:
YYDEBUG(543, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(550, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1621 "Zend/zend_language_scanner.l"
+#line 1615 "Zend/zend_language_scanner.l"
{
return T_BOOL_CAST;
}
-#line 6444 "Zend/zend_language_scanner.c"
+#line 6410 "Zend/zend_language_scanner.c"
yy551:
YYDEBUG(551, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(559, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1609 "Zend/zend_language_scanner.l"
+#line 1603 "Zend/zend_language_scanner.l"
{
return T_BINARY_CAST;
}
-#line 6492 "Zend/zend_language_scanner.c"
+#line 6458 "Zend/zend_language_scanner.c"
yy560:
YYDEBUG(560, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(569, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1605 "Zend/zend_language_scanner.l"
+#line 1599 "Zend/zend_language_scanner.l"
{
return T_UNICODE_CAST;
}
-#line 6553 "Zend/zend_language_scanner.c"
+#line 6519 "Zend/zend_language_scanner.c"
yy570:
YYDEBUG(570, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(574, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1625 "Zend/zend_language_scanner.l"
+#line 1619 "Zend/zend_language_scanner.l"
{
return T_UNSET_CAST;
}
-#line 6580 "Zend/zend_language_scanner.c"
+#line 6546 "Zend/zend_language_scanner.c"
yy575:
YYDEBUG(575, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(577, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1589 "Zend/zend_language_scanner.l"
+#line 1583 "Zend/zend_language_scanner.l"
{
return T_VAR;
}
-#line 6598 "Zend/zend_language_scanner.c"
+#line 6564 "Zend/zend_language_scanner.c"
yy578:
YYDEBUG(578, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(581, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1581 "Zend/zend_language_scanner.l"
+#line 1575 "Zend/zend_language_scanner.l"
{
return T_NEW;
}
-#line 6622 "Zend/zend_language_scanner.c"
+#line 6588 "Zend/zend_language_scanner.c"
yy582:
YYDEBUG(582, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(589, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1649 "Zend/zend_language_scanner.l"
+#line 1643 "Zend/zend_language_scanner.l"
{
return T_NAMESPACE;
}
-#line 6665 "Zend/zend_language_scanner.c"
+#line 6631 "Zend/zend_language_scanner.c"
yy590:
YYDEBUG(590, *YYCURSOR);
++YYCURSOR;
YYDEBUG(591, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1573 "Zend/zend_language_scanner.l"
+#line 1567 "Zend/zend_language_scanner.l"
{
return T_PAAMAYIM_NEKUDOTAYIM;
}
-#line 6675 "Zend/zend_language_scanner.c"
+#line 6641 "Zend/zend_language_scanner.c"
yy592:
YYDEBUG(592, *YYCURSOR);
++YYCURSOR;
++YYCURSOR;
YYDEBUG(595, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1749 "Zend/zend_language_scanner.l"
+#line 1743 "Zend/zend_language_scanner.l"
{
return T_MINUS_EQUAL;
}
-#line 6701 "Zend/zend_language_scanner.c"
+#line 6667 "Zend/zend_language_scanner.c"
yy596:
YYDEBUG(596, *YYCURSOR);
++YYCURSOR;
YYDEBUG(597, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1717 "Zend/zend_language_scanner.l"
+#line 1711 "Zend/zend_language_scanner.l"
{
return T_DEC;
}
-#line 6711 "Zend/zend_language_scanner.c"
+#line 6677 "Zend/zend_language_scanner.c"
yy598:
YYDEBUG(598, *YYCURSOR);
++YYCURSOR;
YYDEBUG(599, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1539 "Zend/zend_language_scanner.l"
+#line 1533 "Zend/zend_language_scanner.l"
{
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
return T_OBJECT_OPERATOR;
}
-#line 6722 "Zend/zend_language_scanner.c"
+#line 6688 "Zend/zend_language_scanner.c"
yy600:
YYDEBUG(600, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(606, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1693 "Zend/zend_language_scanner.l"
+#line 1687 "Zend/zend_language_scanner.l"
{
return T_PUBLIC;
}
-#line 6771 "Zend/zend_language_scanner.c"
+#line 6737 "Zend/zend_language_scanner.c"
yy607:
YYDEBUG(607, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(615, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1689 "Zend/zend_language_scanner.l"
+#line 1683 "Zend/zend_language_scanner.l"
{
return T_PROTECTED;
}
-#line 6830 "Zend/zend_language_scanner.c"
+#line 6796 "Zend/zend_language_scanner.c"
yy616:
YYDEBUG(616, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(621, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1685 "Zend/zend_language_scanner.l"
+#line 1679 "Zend/zend_language_scanner.l"
{
return T_PRIVATE;
}
-#line 6864 "Zend/zend_language_scanner.c"
+#line 6830 "Zend/zend_language_scanner.c"
yy622:
YYDEBUG(622, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(623, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1519 "Zend/zend_language_scanner.l"
+#line 1513 "Zend/zend_language_scanner.l"
{
return T_PRINT;
}
-#line 6877 "Zend/zend_language_scanner.c"
+#line 6843 "Zend/zend_language_scanner.c"
yy624:
YYDEBUG(624, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(628, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1511 "Zend/zend_language_scanner.l"
+#line 1505 "Zend/zend_language_scanner.l"
{
return T_GOTO;
}
-#line 6906 "Zend/zend_language_scanner.c"
+#line 6872 "Zend/zend_language_scanner.c"
yy629:
YYDEBUG(629, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(633, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1657 "Zend/zend_language_scanner.l"
+#line 1651 "Zend/zend_language_scanner.l"
{
return T_GLOBAL;
}
-#line 6934 "Zend/zend_language_scanner.c"
+#line 6900 "Zend/zend_language_scanner.c"
yy634:
YYDEBUG(634, *YYCURSOR);
yych = *++YYCURSOR;
yy636:
YYDEBUG(636, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2396 "Zend/zend_language_scanner.l"
+#line 2362 "Zend/zend_language_scanner.l"
{
BEGIN(ST_DOUBLE_QUOTES);
return T_BINARY_DOUBLE;
}
-#line 6953 "Zend/zend_language_scanner.c"
+#line 6919 "Zend/zend_language_scanner.c"
yy637:
YYDEBUG(637, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(643, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1503 "Zend/zend_language_scanner.l"
+#line 1497 "Zend/zend_language_scanner.l"
{
return T_BREAK;
}
-#line 6990 "Zend/zend_language_scanner.c"
+#line 6956 "Zend/zend_language_scanner.c"
yy644:
YYDEBUG(644, *YYCURSOR);
++YYCURSOR;
++YYCURSOR;
YYDEBUG(646, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2385 "Zend/zend_language_scanner.l"
+#line 2351 "Zend/zend_language_scanner.l"
{
zend_scan_binary_single_string(zendlval, yytext+2, yyleng-3 TSRMLS_CC);
return T_CONSTANT_ENCAPSED_STRING;
}
-#line 7008 "Zend/zend_language_scanner.c"
+#line 6974 "Zend/zend_language_scanner.c"
yy647:
YYDEBUG(647, *YYCURSOR);
++YYCURSOR;
++YYCURSOR;
YYDEBUG(655, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2369 "Zend/zend_language_scanner.l"
+#line 2340 "Zend/zend_language_scanner.l"
{
zend_scan_binary_escape_string(zendlval, yytext+2, yyleng-3, '"' TSRMLS_CC);
return T_CONSTANT_ENCAPSED_STRING;
}
-#line 7088 "Zend/zend_language_scanner.c"
+#line 7054 "Zend/zend_language_scanner.c"
yy656:
YYDEBUG(656, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(664, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1487 "Zend/zend_language_scanner.l"
+#line 1481 "Zend/zend_language_scanner.l"
{
return T_SWITCH;
}
-#line 7139 "Zend/zend_language_scanner.c"
+#line 7105 "Zend/zend_language_scanner.c"
yy665:
YYDEBUG(665, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(669, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1673 "Zend/zend_language_scanner.l"
+#line 1667 "Zend/zend_language_scanner.l"
{
return T_STATIC;
}
-#line 7167 "Zend/zend_language_scanner.c"
+#line 7133 "Zend/zend_language_scanner.c"
yy670:
YYDEBUG(670, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(674, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1483 "Zend/zend_language_scanner.l"
+#line 1477 "Zend/zend_language_scanner.l"
{
return T_AS;
}
-#line 7198 "Zend/zend_language_scanner.c"
+#line 7164 "Zend/zend_language_scanner.c"
yy675:
YYDEBUG(675, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(678, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1709 "Zend/zend_language_scanner.l"
+#line 1703 "Zend/zend_language_scanner.l"
{
return T_ARRAY;
}
-#line 7221 "Zend/zend_language_scanner.c"
+#line 7187 "Zend/zend_language_scanner.c"
yy679:
YYDEBUG(679, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(680, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1801 "Zend/zend_language_scanner.l"
+#line 1795 "Zend/zend_language_scanner.l"
{
return T_LOGICAL_AND;
}
-#line 7234 "Zend/zend_language_scanner.c"
+#line 7200 "Zend/zend_language_scanner.c"
yy681:
YYDEBUG(681, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(687, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1677 "Zend/zend_language_scanner.l"
+#line 1671 "Zend/zend_language_scanner.l"
{
return T_ABSTRACT;
}
-#line 7272 "Zend/zend_language_scanner.c"
+#line 7238 "Zend/zend_language_scanner.c"
yy688:
YYDEBUG(688, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(692, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1443 "Zend/zend_language_scanner.l"
+#line 1437 "Zend/zend_language_scanner.l"
{
return T_WHILE;
}
-#line 7300 "Zend/zend_language_scanner.c"
+#line 7266 "Zend/zend_language_scanner.c"
yy693:
YYDEBUG(693, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(694, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1427 "Zend/zend_language_scanner.l"
+#line 1421 "Zend/zend_language_scanner.l"
{
return T_IF;
}
-#line 7313 "Zend/zend_language_scanner.c"
+#line 7279 "Zend/zend_language_scanner.c"
yy695:
YYDEBUG(695, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(701, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1661 "Zend/zend_language_scanner.l"
+#line 1655 "Zend/zend_language_scanner.l"
{
return T_ISSET;
}
-#line 7369 "Zend/zend_language_scanner.c"
+#line 7335 "Zend/zend_language_scanner.c"
yy702:
YYDEBUG(702, *YYCURSOR);
yych = *++YYCURSOR;
yy709:
YYDEBUG(709, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1633 "Zend/zend_language_scanner.l"
+#line 1627 "Zend/zend_language_scanner.l"
{
return T_INCLUDE;
}
-#line 7427 "Zend/zend_language_scanner.c"
+#line 7393 "Zend/zend_language_scanner.c"
yy710:
YYDEBUG(710, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(715, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1637 "Zend/zend_language_scanner.l"
+#line 1631 "Zend/zend_language_scanner.l"
{
return T_INCLUDE_ONCE;
}
-#line 7460 "Zend/zend_language_scanner.c"
+#line 7426 "Zend/zend_language_scanner.c"
yy716:
YYDEBUG(716, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(722, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1527 "Zend/zend_language_scanner.l"
+#line 1521 "Zend/zend_language_scanner.l"
{
return T_INTERFACE;
}
-#line 7498 "Zend/zend_language_scanner.c"
+#line 7464 "Zend/zend_language_scanner.c"
yy723:
YYDEBUG(723, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(730, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1479 "Zend/zend_language_scanner.l"
+#line 1473 "Zend/zend_language_scanner.l"
{
return T_INSTANCEOF;
}
-#line 7541 "Zend/zend_language_scanner.c"
+#line 7507 "Zend/zend_language_scanner.c"
yy731:
YYDEBUG(731, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(739, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1535 "Zend/zend_language_scanner.l"
+#line 1529 "Zend/zend_language_scanner.l"
{
return T_IMPLEMENTS;
}
-#line 7589 "Zend/zend_language_scanner.c"
+#line 7555 "Zend/zend_language_scanner.c"
yy740:
YYDEBUG(740, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(743, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1415 "Zend/zend_language_scanner.l"
+#line 1409 "Zend/zend_language_scanner.l"
{
return T_TRY;
}
-#line 7613 "Zend/zend_language_scanner.c"
+#line 7579 "Zend/zend_language_scanner.c"
yy744:
YYDEBUG(744, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(747, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1423 "Zend/zend_language_scanner.l"
+#line 1417 "Zend/zend_language_scanner.l"
{
return T_THROW;
}
-#line 7636 "Zend/zend_language_scanner.c"
+#line 7602 "Zend/zend_language_scanner.c"
yy748:
YYDEBUG(748, *YYCURSOR);
yych = *++YYCURSOR;
yy755:
YYDEBUG(755, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1641 "Zend/zend_language_scanner.l"
+#line 1635 "Zend/zend_language_scanner.l"
{
return T_REQUIRE;
}
-#line 7701 "Zend/zend_language_scanner.c"
+#line 7667 "Zend/zend_language_scanner.c"
yy756:
YYDEBUG(756, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(761, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1645 "Zend/zend_language_scanner.l"
+#line 1639 "Zend/zend_language_scanner.l"
{
return T_REQUIRE_ONCE;
}
-#line 7734 "Zend/zend_language_scanner.c"
+#line 7700 "Zend/zend_language_scanner.c"
yy762:
YYDEBUG(762, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(765, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1411 "Zend/zend_language_scanner.l"
+#line 1405 "Zend/zend_language_scanner.l"
{
return T_RETURN;
}
-#line 7757 "Zend/zend_language_scanner.c"
+#line 7723 "Zend/zend_language_scanner.c"
yy766:
YYDEBUG(766, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(776, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1507 "Zend/zend_language_scanner.l"
+#line 1501 "Zend/zend_language_scanner.l"
{
return T_CONTINUE;
}
-#line 7842 "Zend/zend_language_scanner.c"
+#line 7808 "Zend/zend_language_scanner.c"
yy777:
YYDEBUG(777, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(778, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1407 "Zend/zend_language_scanner.l"
+#line 1401 "Zend/zend_language_scanner.l"
{
return T_CONST;
}
-#line 7855 "Zend/zend_language_scanner.c"
+#line 7821 "Zend/zend_language_scanner.c"
yy779:
YYDEBUG(779, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(783, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1585 "Zend/zend_language_scanner.l"
+#line 1579 "Zend/zend_language_scanner.l"
{
return T_CLONE;
}
-#line 7884 "Zend/zend_language_scanner.c"
+#line 7850 "Zend/zend_language_scanner.c"
yy784:
YYDEBUG(784, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(786, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1523 "Zend/zend_language_scanner.l"
+#line 1517 "Zend/zend_language_scanner.l"
{
return T_CLASS;
}
-#line 7902 "Zend/zend_language_scanner.c"
+#line 7868 "Zend/zend_language_scanner.c"
yy787:
YYDEBUG(787, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(790, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1495 "Zend/zend_language_scanner.l"
+#line 1489 "Zend/zend_language_scanner.l"
{
return T_CASE;
}
-#line 7926 "Zend/zend_language_scanner.c"
+#line 7892 "Zend/zend_language_scanner.c"
yy791:
YYDEBUG(791, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(793, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1419 "Zend/zend_language_scanner.l"
+#line 1413 "Zend/zend_language_scanner.l"
{
return T_CATCH;
}
-#line 7944 "Zend/zend_language_scanner.c"
+#line 7910 "Zend/zend_language_scanner.c"
yy794:
YYDEBUG(794, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(803, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1403 "Zend/zend_language_scanner.l"
+#line 1397 "Zend/zend_language_scanner.l"
{
return T_FUNCTION;
}
-#line 7999 "Zend/zend_language_scanner.c"
+#line 7965 "Zend/zend_language_scanner.c"
yy804:
YYDEBUG(804, *YYCURSOR);
++YYCURSOR;
yy805:
YYDEBUG(805, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1455 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
{
return T_FOR;
}
-#line 8027 "Zend/zend_language_scanner.c"
+#line 7993 "Zend/zend_language_scanner.c"
yy806:
YYDEBUG(806, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(810, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1463 "Zend/zend_language_scanner.l"
+#line 1457 "Zend/zend_language_scanner.l"
{
return T_FOREACH;
}
-#line 8055 "Zend/zend_language_scanner.c"
+#line 8021 "Zend/zend_language_scanner.c"
yy811:
YYDEBUG(811, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(814, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1681 "Zend/zend_language_scanner.l"
+#line 1675 "Zend/zend_language_scanner.l"
{
return T_FINAL;
}
-#line 8078 "Zend/zend_language_scanner.c"
+#line 8044 "Zend/zend_language_scanner.c"
yy815:
YYDEBUG(815, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(818, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1451 "Zend/zend_language_scanner.l"
+#line 1445 "Zend/zend_language_scanner.l"
{
return T_DO;
}
-#line 8113 "Zend/zend_language_scanner.c"
+#line 8079 "Zend/zend_language_scanner.c"
yy819:
YYDEBUG(819, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(820, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1399 "Zend/zend_language_scanner.l"
+#line 1393 "Zend/zend_language_scanner.l"
{
return T_EXIT;
}
-#line 8126 "Zend/zend_language_scanner.c"
+#line 8092 "Zend/zend_language_scanner.c"
yy821:
YYDEBUG(821, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(827, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1499 "Zend/zend_language_scanner.l"
+#line 1493 "Zend/zend_language_scanner.l"
{
return T_DEFAULT;
}
-#line 8165 "Zend/zend_language_scanner.c"
+#line 8131 "Zend/zend_language_scanner.c"
yy828:
YYDEBUG(828, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(832, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1471 "Zend/zend_language_scanner.l"
+#line 1465 "Zend/zend_language_scanner.l"
{
return T_DECLARE;
}
-#line 8193 "Zend/zend_language_scanner.c"
+#line 8159 "Zend/zend_language_scanner.c"
yy833:
YYDEBUG(833, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(845, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1531 "Zend/zend_language_scanner.l"
+#line 1525 "Zend/zend_language_scanner.l"
{
return T_EXTENDS;
}
-#line 8277 "Zend/zend_language_scanner.c"
+#line 8243 "Zend/zend_language_scanner.c"
yy846:
YYDEBUG(846, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(847, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1395 "Zend/zend_language_scanner.l"
+#line 1389 "Zend/zend_language_scanner.l"
{
return T_EXIT;
}
-#line 8290 "Zend/zend_language_scanner.c"
+#line 8256 "Zend/zend_language_scanner.c"
yy848:
YYDEBUG(848, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(850, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1629 "Zend/zend_language_scanner.l"
+#line 1623 "Zend/zend_language_scanner.l"
{
return T_EVAL;
}
-#line 8308 "Zend/zend_language_scanner.c"
+#line 8274 "Zend/zend_language_scanner.c"
yy851:
YYDEBUG(851, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(861, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1447 "Zend/zend_language_scanner.l"
+#line 1441 "Zend/zend_language_scanner.l"
{
return T_ENDWHILE;
}
-#line 8382 "Zend/zend_language_scanner.c"
+#line 8348 "Zend/zend_language_scanner.c"
yy862:
YYDEBUG(862, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(867, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1491 "Zend/zend_language_scanner.l"
+#line 1485 "Zend/zend_language_scanner.l"
{
return T_ENDSWITCH;
}
-#line 8415 "Zend/zend_language_scanner.c"
+#line 8381 "Zend/zend_language_scanner.c"
yy868:
YYDEBUG(868, *YYCURSOR);
++YYCURSOR;
}
YYDEBUG(869, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1435 "Zend/zend_language_scanner.l"
+#line 1429 "Zend/zend_language_scanner.l"
{
return T_ENDIF;
}
-#line 8428 "Zend/zend_language_scanner.c"
+#line 8394 "Zend/zend_language_scanner.c"
yy870:
YYDEBUG(870, *YYCURSOR);
yych = *++YYCURSOR;
yy872:
YYDEBUG(872, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1459 "Zend/zend_language_scanner.l"
+#line 1453 "Zend/zend_language_scanner.l"
{
return T_ENDFOR;
}
-#line 8461 "Zend/zend_language_scanner.c"
+#line 8427 "Zend/zend_language_scanner.c"
yy873:
YYDEBUG(873, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(877, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1467 "Zend/zend_language_scanner.l"
+#line 1461 "Zend/zend_language_scanner.l"
{
return T_ENDFOREACH;
}
-#line 8489 "Zend/zend_language_scanner.c"
+#line 8455 "Zend/zend_language_scanner.c"
yy878:
YYDEBUG(878, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(884, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1475 "Zend/zend_language_scanner.l"
+#line 1469 "Zend/zend_language_scanner.l"
{
return T_ENDDECLARE;
}
-#line 8527 "Zend/zend_language_scanner.c"
+#line 8493 "Zend/zend_language_scanner.c"
yy885:
YYDEBUG(885, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(888, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1665 "Zend/zend_language_scanner.l"
+#line 1659 "Zend/zend_language_scanner.l"
{
return T_EMPTY;
}
-#line 8550 "Zend/zend_language_scanner.c"
+#line 8516 "Zend/zend_language_scanner.c"
yy889:
YYDEBUG(889, *YYCURSOR);
yych = *++YYCURSOR;
yy891:
YYDEBUG(891, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1439 "Zend/zend_language_scanner.l"
+#line 1433 "Zend/zend_language_scanner.l"
{
return T_ELSE;
}
-#line 8583 "Zend/zend_language_scanner.c"
+#line 8549 "Zend/zend_language_scanner.c"
yy892:
YYDEBUG(892, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(894, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1431 "Zend/zend_language_scanner.l"
+#line 1425 "Zend/zend_language_scanner.l"
{
return T_ELSEIF;
}
-#line 8601 "Zend/zend_language_scanner.c"
+#line 8567 "Zend/zend_language_scanner.c"
yy895:
YYDEBUG(895, *YYCURSOR);
yych = *++YYCURSOR;
}
YYDEBUG(897, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1515 "Zend/zend_language_scanner.l"
+#line 1509 "Zend/zend_language_scanner.l"
{
return T_ECHO;
}
-#line 8619 "Zend/zend_language_scanner.c"
+#line 8585 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_LOOKING_FOR_PROPERTY:
++YYCURSOR;
YYDEBUG(901, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 8696 "Zend/zend_language_scanner.c"
+#line 8662 "Zend/zend_language_scanner.c"
yy902:
YYDEBUG(902, *YYCURSOR);
++YYCURSOR;
yy903:
YYDEBUG(903, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1544 "Zend/zend_language_scanner.l"
+#line 1538 "Zend/zend_language_scanner.l"
{
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
Z_STRLEN_P(zendlval) = yyleng;
HANDLE_NEWLINES(yytext, yyleng);
return T_WHITESPACE;
}
-#line 8713 "Zend/zend_language_scanner.c"
+#line 8679 "Zend/zend_language_scanner.c"
yy904:
YYDEBUG(904, *YYCURSOR);
++YYCURSOR;
yy905:
YYDEBUG(905, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1567 "Zend/zend_language_scanner.l"
+#line 1561 "Zend/zend_language_scanner.l"
{
yyless(0);
yy_pop_state(TSRMLS_C);
goto restart;
}
-#line 8727 "Zend/zend_language_scanner.c"
+#line 8693 "Zend/zend_language_scanner.c"
yy906:
YYDEBUG(906, *YYCURSOR);
++YYCURSOR;
yy907:
YYDEBUG(907, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1556 "Zend/zend_language_scanner.l"
+#line 1550 "Zend/zend_language_scanner.l"
{
yy_pop_state(TSRMLS_C);
- if (!zend_copy_scanner_string(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_STRING;
}
-#line 8747 "Zend/zend_language_scanner.c"
+#line 8713 "Zend/zend_language_scanner.c"
yy908:
YYDEBUG(908, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(912, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1552 "Zend/zend_language_scanner.l"
+#line 1546 "Zend/zend_language_scanner.l"
{
return T_OBJECT_OPERATOR;
}
-#line 8772 "Zend/zend_language_scanner.c"
+#line 8738 "Zend/zend_language_scanner.c"
yy913:
YYDEBUG(913, *YYCURSOR);
++YYCURSOR;
++YYCURSOR;
YYDEBUG(918, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 8847 "Zend/zend_language_scanner.c"
+#line 8813 "Zend/zend_language_scanner.c"
yy919:
YYDEBUG(919, *YYCURSOR);
++YYCURSOR;
yy920:
YYDEBUG(920, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1843 "Zend/zend_language_scanner.l"
+#line 1837 "Zend/zend_language_scanner.l"
{
- if (!zend_copy_scanner_string(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
yy_pop_state(TSRMLS_C);
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
return T_STRING_VARNAME;
}
-#line 8868 "Zend/zend_language_scanner.c"
+#line 8834 "Zend/zend_language_scanner.c"
yy921:
YYDEBUG(921, *YYCURSOR);
++YYCURSOR;
YYDEBUG(922, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1856 "Zend/zend_language_scanner.l"
+#line 1850 "Zend/zend_language_scanner.l"
{
yyless(0);
yy_pop_state(TSRMLS_C);
yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
goto restart;
}
-#line 8881 "Zend/zend_language_scanner.c"
+#line 8847 "Zend/zend_language_scanner.c"
yy923:
YYDEBUG(923, *YYCURSOR);
++YYCURSOR;
goto yy930;
YYDEBUG(928, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 8949 "Zend/zend_language_scanner.c"
+#line 8915 "Zend/zend_language_scanner.c"
yy929:
YYDEBUG(929, *YYCURSOR);
++YYCURSOR;
++YYCURSOR;
YYDEBUG(939, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2601 "Zend/zend_language_scanner.l"
+#line 2567 "Zend/zend_language_scanner.l"
{
char *end = yytext + yyleng - 1;
yymore();
}
}
-#line 9083 "Zend/zend_language_scanner.c"
+#line 9049 "Zend/zend_language_scanner.c"
yy940:
YYDEBUG(940, *YYCURSOR);
++YYCURSOR;
goto yy961;
YYDEBUG(947, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 9196 "Zend/zend_language_scanner.c"
+#line 9162 "Zend/zend_language_scanner.c"
yy948:
YYDEBUG(948, *YYCURSOR);
++YYCURSOR;
yy949:
YYDEBUG(949, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2246 "Zend/zend_language_scanner.l"
+#line 2222 "Zend/zend_language_scanner.l"
{
yymore();
}
-#line 9208 "Zend/zend_language_scanner.c"
+#line 9174 "Zend/zend_language_scanner.c"
yy950:
YYDEBUG(950, *YYCURSOR);
yych = *++YYCURSOR;
yy954:
YYDEBUG(954, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2250 "Zend/zend_language_scanner.l"
+#line 2226 "Zend/zend_language_scanner.l"
{
switch (yytext[yyleng-1]) {
case '?': case '%': case '>':
return T_COMMENT;
}
}
-#line 9263 "Zend/zend_language_scanner.c"
+#line 9229 "Zend/zend_language_scanner.c"
yy955:
YYDEBUG(955, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(958, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2268 "Zend/zend_language_scanner.l"
+#line 2244 "Zend/zend_language_scanner.l"
{
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
Z_STRLEN_P(zendlval) = yyleng;
CG(zend_lineno)++;
return T_COMMENT;
}
-#line 9285 "Zend/zend_language_scanner.c"
+#line 9251 "Zend/zend_language_scanner.c"
yy959:
YYDEBUG(959, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(963, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2277 "Zend/zend_language_scanner.l"
+#line 2253 "Zend/zend_language_scanner.l"
{
if (CG(asp_tags) || yytext[yyleng-2] != '%') { /* asp comment? */
Z_STRVAL_P(zendlval) = yytext; /* no copying - intentional */
yymore();
}
}
-#line 9332 "Zend/zend_language_scanner.c"
+#line 9298 "Zend/zend_language_scanner.c"
}
/* *********************************** */
yyc_ST_VAR_OFFSET:
++YYCURSOR;
YYDEBUG(967, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2654 "Zend/zend_language_scanner.l"
+#line 2620 "Zend/zend_language_scanner.l"
{ return 0; }
-#line 9426 "Zend/zend_language_scanner.c"
+#line 9392 "Zend/zend_language_scanner.c"
yy968:
YYDEBUG(968, *YYCURSOR);
yyaccept = 0;
yy969:
YYDEBUG(969, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1906 "Zend/zend_language_scanner.l"
+#line 1900 "Zend/zend_language_scanner.l"
{ /* Offset could be treated as a long */
if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
Z_LVAL_P(zendlval) = strtol(yytext, NULL, 10);
}
return T_NUM_STRING;
}
-#line 9453 "Zend/zend_language_scanner.c"
+#line 9419 "Zend/zend_language_scanner.c"
yy970:
YYDEBUG(970, *YYCURSOR);
yych = *++YYCURSOR;
yy972:
YYDEBUG(972, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2210 "Zend/zend_language_scanner.l"
+#line 2186 "Zend/zend_language_scanner.l"
{
/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
return yytext[0];
}
-#line 9478 "Zend/zend_language_scanner.c"
+#line 9444 "Zend/zend_language_scanner.c"
yy973:
YYDEBUG(973, *YYCURSOR);
++YYCURSOR;
YYDEBUG(974, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2205 "Zend/zend_language_scanner.l"
+#line 2181 "Zend/zend_language_scanner.l"
{
yy_pop_state(TSRMLS_C);
return ']';
}
-#line 9489 "Zend/zend_language_scanner.c"
+#line 9455 "Zend/zend_language_scanner.c"
yy975:
YYDEBUG(975, *YYCURSOR);
yych = *++YYCURSOR;
++YYCURSOR;
YYDEBUG(977, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2215 "Zend/zend_language_scanner.l"
+#line 2191 "Zend/zend_language_scanner.l"
{
/* Invalid rule to return a more explicit parse error with proper line number */
yyless(0);
ZVAL_EMPTY_TEXT(zendlval); /* Empty since it won't be used */
return T_ENCAPSED_AND_WHITESPACE;
}
-#line 9507 "Zend/zend_language_scanner.c"
+#line 9473 "Zend/zend_language_scanner.c"
yy978:
YYDEBUG(978, *YYCURSOR);
++YYCURSOR;
yy979:
YYDEBUG(979, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2233 "Zend/zend_language_scanner.l"
+#line 2209 "Zend/zend_language_scanner.l"
{
if (!zend_copy_scanner_string(zendlval, yytext, yyleng, CG(literal_type), SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
return T_STRING;
}
-#line 9523 "Zend/zend_language_scanner.c"
+#line 9489 "Zend/zend_language_scanner.c"
yy980:
YYDEBUG(980, *YYCURSOR);
++YYCURSOR;
YYDEBUG(981, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2656 "Zend/zend_language_scanner.l"
+#line 2622 "Zend/zend_language_scanner.l"
{
zend_error(E_COMPILE_WARNING,"Unexpected character in input: '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
goto restart;
}
-#line 9534 "Zend/zend_language_scanner.c"
+#line 9500 "Zend/zend_language_scanner.c"
yy982:
YYDEBUG(982, *YYCURSOR);
++YYCURSOR;
yy986:
YYDEBUG(986, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 2195 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
{
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
-#line 9580 "Zend/zend_language_scanner.c"
+#line 9546 "Zend/zend_language_scanner.c"
yy987:
YYDEBUG(987, *YYCURSOR);
++YYCURSOR;
yy993:
YYDEBUG(993, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
-#line 1918 "Zend/zend_language_scanner.l"
+#line 1912 "Zend/zend_language_scanner.l"
{ /* Offset must be treated as a string */
if (!zend_copy_scanner_string(zendlval, yytext, yyleng, CG(literal_type), SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
return T_NUM_STRING;
}
-#line 9619 "Zend/zend_language_scanner.c"
+#line 9585 "Zend/zend_language_scanner.c"
yy994:
YYDEBUG(994, *YYCURSOR);
++YYCURSOR;
goto yy993;
}
}
-#line 2661 "Zend/zend_language_scanner.l"
+#line 2627 "Zend/zend_language_scanner.l"
}
n = zend_stream_read(file_handle, buf, len TSRMLS_CC);
}
#endif
-
- /* Don't make any conversions if unicode=off */
- if (!UG(unicode)) {
- return n;
- }
-
/* Autodetect encoding */
if (!SCNG(encoding_checked)) {
int32_t signatureLength;
tmp = *source_string;
zval_copy_ctor(&tmp);
if (Z_TYPE(tmp) != IS_STRING && Z_TYPE(tmp) != IS_UNICODE) {
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
}
source_string = &tmp;
<ST_LOOKING_FOR_PROPERTY>{LABEL} {
yy_pop_state(TSRMLS_C);
- if (!zend_copy_scanner_string(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_STRING;
<ST_LOOKING_FOR_VARNAME>{LABEL} {
- if (!zend_copy_scanner_string(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
yy_pop_state(TSRMLS_C);
zstr class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL_ZSTR;
zstr func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL_ZSTR;
size_t len = 0;
+ size_t len1;
- if (UG(unicode)) {
- size_t len1;
-
- if (class_name.u) {
- len += len1 = u_strlen(class_name.u);
- len += 2;
- }
- if (func_name.u) {
- len += u_strlen(func_name.u);
- } else {
- func_name.u = EMPTY_STR;
- }
- Z_USTRLEN_P(zendlval) = len;
- Z_USTRVAL_P(zendlval) = eumalloc(len+1);
- if (class_name.u) {
- u_strcpy(Z_USTRVAL_P(zendlval), class_name.u);
- Z_USTRVAL_P(zendlval)[len1] = 0x3a; /* ':' */
- Z_USTRVAL_P(zendlval)[len1+1] = 0x3a; /* ':' */
- Z_USTRVAL_P(zendlval)[len1+2] = 0;
- } else {
- Z_USTRVAL_P(zendlval)[0] = 0;
- }
- u_strcat(Z_USTRVAL_P(zendlval), func_name.u);
- Z_TYPE_P(zendlval) = IS_UNICODE;
+ if (class_name.u) {
+ len += len1 = u_strlen(class_name.u);
+ len += 2;
+ }
+ if (func_name.u) {
+ len += u_strlen(func_name.u);
} else {
- if (class_name.s) {
- len += strlen(class_name.s) + 2;
- }
- if (func_name.s) {
- len += strlen(func_name.s);
- }
-
- Z_STRVAL_P(zendlval) = emalloc(len+1);
- Z_STRLEN_P(zendlval) = sprintf(Z_STRVAL_P(zendlval), "%s%s%s",
- class_name.s ? class_name.s : "",
- class_name.s && func_name.s ? "::" : "",
- func_name.s ? func_name.s : ""
- );
- Z_STRLEN_P(zendlval) = strlen(Z_STRVAL_P(zendlval));
- Z_TYPE_P(zendlval) = IS_STRING;
+ func_name.u = EMPTY_STR;
+ }
+ Z_USTRLEN_P(zendlval) = len;
+ Z_USTRVAL_P(zendlval) = eumalloc(len+1);
+ if (class_name.u) {
+ u_strcpy(Z_USTRVAL_P(zendlval), class_name.u);
+ Z_USTRVAL_P(zendlval)[len1] = 0x3a; /* ':' */
+ Z_USTRVAL_P(zendlval)[len1+1] = 0x3a; /* ':' */
+ Z_USTRVAL_P(zendlval)[len1+2] = 0;
+ } else {
+ Z_USTRVAL_P(zendlval)[0] = 0;
}
+ u_strcat(Z_USTRVAL_P(zendlval), func_name.u);
+ Z_TYPE_P(zendlval) = IS_UNICODE;
+
return T_METHOD_C;
}
yyless(yyleng - 3);
yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
yyless(yyleng - 1);
yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
<ST_IN_SCRIPTING,ST_DOUBLE_QUOTES,ST_HEREDOC,ST_BACKQUOTE,ST_VAR_OFFSET>"$"{LABEL} {
- if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, (yytext+1), (yyleng-1), IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_VARIABLE;
}
<ST_IN_SCRIPTING>{LABEL} {
- if (!zend_copy_scanner_string(zendlval, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(zendlval, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
- if (UG(unicode) && !zend_check_and_normalize_identifier(zendlval)) {
+ if (!zend_check_and_normalize_identifier(zendlval)) {
return 0;
}
return T_STRING;
zval temp;
HANDLE_NEWLINES(yytext, yyleng);
- if (!zend_copy_scanner_string(&temp, yytext, yyleng, UG(unicode)?IS_UNICODE:IS_STRING, SCNG(output_conv) TSRMLS_CC)) {
+ if (!zend_copy_scanner_string(&temp, yytext, yyleng, IS_UNICODE, SCNG(output_conv) TSRMLS_CC)) {
return 0;
}
CG(doc_comment) = temp.value.uni.val;
/* ("{"*|"$"*) handles { or $ at the end of a string (or the entire contents)
*/
<ST_IN_SCRIPTING>(["]{DOUBLE_QUOTES_CHARS}*("{"*|"$"*)["]) {
- if (UG(unicode)) {
- return zend_scan_unicode_escape_string(zendlval, yytext+1, yyleng-2, 0x22 /*'"'*/, T_CONSTANT_ENCAPSED_STRING TSRMLS_CC);
- } else {
- zend_scan_binary_escape_string(zendlval, yytext+1, yyleng-2, '"' TSRMLS_CC);
- return T_CONSTANT_ENCAPSED_STRING;
- }
+ return zend_scan_unicode_escape_string(zendlval, yytext+1, yyleng-2, 0x22 /*'"'*/, T_CONSTANT_ENCAPSED_STRING TSRMLS_CC);
}
<ST_IN_SCRIPTING>([']([^'\\]|("\\"{ANY_CHAR}))*[']) {
- if (UG(unicode)) {
- return zend_scan_unicode_single_string(zendlval TSRMLS_CC);
- } else {
- zend_scan_binary_single_string(zendlval, yytext+1, yyleng-2 TSRMLS_CC);
- return T_CONSTANT_ENCAPSED_STRING;
- }
+ return zend_scan_unicode_single_string(zendlval TSRMLS_CC);
}
-/* Generated by re2c 0.13.5 on Thu Mar 26 15:38:15 2009 */
+/* Generated by re2c 0.13.5 on Thu Mar 26 16:22:31 2009 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
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 (!UG(unicode) && strcmp(prop_info_name.s+1, property_info->name.s+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(prop_info_name.u+1, property_info->name.u+1)) {
+ } else if (u_strcmp(prop_info_name.u+1, property_info->name.u+1)) {
/* we we're looking for a private prop but found a private one of the same name but another class */
return FAILURE;
}
if (!zobj->guards) {
ALLOC_HASHTABLE(zobj->guards);
zend_u_hash_init(zobj->guards, 0, NULL, NULL, 0, UG(unicode));
- } else if (zend_u_hash_quick_find(zobj->guards, UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, property_info->name_length+1, property_info->h, (void **) pguard) == SUCCESS) {
+ } else if (zend_u_hash_quick_find(zobj->guards, IS_UNICODE, property_info->name, property_info->name_length+1, property_info->h, (void **) pguard) == SUCCESS) {
return SUCCESS;
}
stub.in_get = 0;
stub.in_set = 0;
stub.in_unset = 0;
stub.in_isset = 0;
- return zend_u_hash_quick_add(zobj->guards, UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, property_info->name_length+1, property_info->h, (void**)&stub, sizeof(stub), (void**) pguard);
+ return zend_u_hash_quick_add(zobj->guards, IS_UNICODE, property_info->name, property_info->name_length+1, property_info->h, (void**)&stub, sizeof(stub), (void**) pguard);
}
/* }}} */
silent = (type == BP_VAR_IS);
zobj = Z_OBJ_P(object);
- if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
+ if (Z_TYPE_P(member) != IS_UNICODE) {
ALLOC_ZVAL(tmp_member);
*tmp_member = *member;
INIT_PZVAL(tmp_member);
zval_copy_ctor(tmp_member);
- convert_to_text(tmp_member);
+ convert_to_unicode(tmp_member);
member = tmp_member;
}
zobj = Z_OBJ_P(object);
- if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
+ if (Z_TYPE_P(member) != IS_UNICODE) {
ALLOC_ZVAL(tmp_member);
*tmp_member = *member;
INIT_PZVAL(tmp_member);
zval_copy_ctor(tmp_member);
- convert_to_text(tmp_member);
+ convert_to_unicode(tmp_member);
member = tmp_member;
}
zobj = Z_OBJ_P(object);
- if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
+ if (Z_TYPE_P(member) != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
zobj = Z_OBJ_P(object);
- if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
+ if (Z_TYPE_P(member) != IS_UNICODE) {
ALLOC_ZVAL(tmp_member);
*tmp_member = *member;
INIT_PZVAL(tmp_member);
zval_copy_ctor(tmp_member);
- convert_to_text(tmp_member);
+ convert_to_unicode(tmp_member);
member = tmp_member;
}
ce = ce->parent;
while (ce) {
if (ce == EG(scope)) {
- if (zend_u_hash_find(&ce->function_table, UG(unicode)?IS_UNICODE:IS_STRING, function_name_strval, function_name_strlen+1, (void **) &fbc)==SUCCESS
+ if (zend_u_hash_find(&ce->function_table, IS_UNICODE, function_name_strval, function_name_strlen+1, (void **) &fbc)==SUCCESS
&& fbc->op_array.fn_flags & ZEND_ACC_PRIVATE
&& fbc->common.scope == EG(scope)) {
return fbc;
call_user_call->num_args = 0;
call_user_call->scope = zobj->ce;
call_user_call->fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
- if (UG(unicode)) {
- call_user_call->function_name.u = eustrndup(method_name.u, method_len);
- } else {
- call_user_call->function_name.s = estrndup(method_name.s, method_len);
- }
+ call_user_call->function_name.u = eustrndup(method_name.u, method_len);
call_user_call->pass_rest_by_reference = 0;
call_user_call->return_reference = ZEND_RETURN_VALUE;
zval *object = *object_ptr;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
/* Create a zend_copy_str_tolower(dest, src, src_length); */
lc_method_name = zend_u_str_case_fold(type, method_name, method_len, 1, &lc_method_name_len);
call_user_call->num_args = 0;
call_user_call->scope = ce;
call_user_call->fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
- if (UG(unicode)) {
- call_user_call->function_name.u = eustrndup(function_name_strval.u, function_name_strlen);
- } else {
- call_user_call->function_name.s = estrndup(function_name_strval.s, function_name_strlen);
- }
+ call_user_call->function_name.u = eustrndup(function_name_strval.u, function_name_strlen);
call_user_call->pass_rest_by_reference = 0;
call_user_call->return_reference = ZEND_RETURN_VALUE;
callstatic_user_call->num_args = 0;
callstatic_user_call->scope = ce;
callstatic_user_call->fn_flags = ZEND_ACC_STATIC | ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER;
-
- if (UG(unicode)) {
- callstatic_user_call->function_name.u = eustrndup(function_name_strval.u, function_name_strlen);
- } else {
- callstatic_user_call->function_name.s = estrndup(function_name_strval.s, function_name_strlen);
- }
-
+ callstatic_user_call->function_name.u = eustrndup(function_name_strval.u, function_name_strlen);
callstatic_user_call->pass_rest_by_reference = 0;
callstatic_user_call->return_reference = ZEND_RETURN_VALUE;
std_property_info.flags = ZEND_ACC_PUBLIC;
std_property_info.name = property_name;
std_property_info.name_length = property_name_len;
- std_property_info.h = zend_u_get_hash_value(UG(unicode)?IS_UNICODE:IS_STRING, std_property_info.name, std_property_info.name_length+1);
+ std_property_info.h = zend_u_get_hash_value(IS_UNICODE, std_property_info.name, std_property_info.name_length+1);
std_property_info.ce = ce;
property_info = &std_property_info;
}
zend_update_class_constants(tmp_ce TSRMLS_CC);
- zend_u_hash_quick_find(CE_STATIC_MEMBERS(tmp_ce), UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval);
+ zend_u_hash_quick_find(CE_STATIC_MEMBERS(tmp_ce), IS_UNICODE, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval);
if (!retval) {
if (silent) {
zobj = Z_OBJ_P(object);
- if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
+ if (Z_TYPE_P(member) != IS_UNICODE) {
ALLOC_ZVAL(tmp_member);
*tmp_member = *member;
INIT_PZVAL(tmp_member);
zval_copy_ctor(tmp_member);
- convert_to_text(tmp_member);
+ convert_to_unicode(tmp_member);
member = tmp_member;
}
}
*class_name_len = ce->name_length;
- if (UG(unicode)) {
- class_name->u = eustrndup(ce->name.u, ce->name_length);
- } else {
- class_name->s = estrndup(ce->name.s, ce->name_length);
- }
+ class_name->u = eustrndup(ce->name.u, ce->name_length);
return SUCCESS;
}
/* }}} */
zend_error(E_ERROR, "Method %v::__toString() must not throw an exception", ce->name);
return FAILURE;
}
- if (Z_TYPE_P(retval) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
+ if (Z_TYPE_P(retval) == IS_UNICODE) {
INIT_PZVAL(writeobj);
if (readobj == writeobj) {
zval_dtor(readobj);
int zend_std_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zval **zobj_ptr TSRMLS_DC) /* {{{ */
{
zstr key;
- zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar utype = IS_UNICODE;
zend_class_entry *ce;
if (Z_TYPE_P(obj) != IS_OBJECT) {
if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) {
result_type = IS_STRING;
- } else if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE || UG(unicode)) {
+ } else {
zend_make_unicode_zval(op1, &op1_copy, &use_copy1);
zend_make_unicode_zval(op2, &op2_copy, &use_copy2);
result_type = IS_UNICODE;
- } else {
- result_type = IS_STRING;
- zend_make_string_zval(op1, &op1_copy, &use_copy1);
- zend_make_string_zval(op2, &op2_copy, &use_copy2);
}
if (use_copy1) {
zval op1_copy, op2_copy;
int use_copy1, use_copy2;
- if (UG(unicode)) {
- zend_make_unicode_zval(op1, &op1_copy, &use_copy1);
- zend_make_unicode_zval(op2, &op2_copy, &use_copy2);
- } else {
- zend_make_string_zval(op1, &op1_copy, &use_copy1);
- zend_make_string_zval(op2, &op2_copy, &use_copy2);
- }
+ zend_make_unicode_zval(op1, &op1_copy, &use_copy1);
+ zend_make_unicode_zval(op2, &op2_copy, &use_copy2);
if (use_copy1) {
op1 = &op1_copy;
op2 = &op2_copy;
}
- if (UG(unicode)) {
- Z_LVAL_P(result) = zend_u_binary_zval_strcmp(op1, op2);
- } else {
- Z_LVAL_P(result) = zend_binary_zval_strcmp(op1, op2);
- }
+ Z_LVAL_P(result) = zend_u_binary_zval_strcmp(op1, op2);
Z_TYPE_P(result) = IS_LONG;
if (use_copy1) {
zval op1_copy, op2_copy;
int use_copy1, use_copy2;
- if (UG(unicode)) {
- zend_make_unicode_zval(op1, &op1_copy, &use_copy1);
- zend_make_unicode_zval(op2, &op2_copy, &use_copy2);
- } else {
- zend_make_string_zval(op1, &op1_copy, &use_copy1);
- zend_make_string_zval(op2, &op2_copy, &use_copy2);
- }
+ zend_make_unicode_zval(op1, &op1_copy, &use_copy1);
+ zend_make_unicode_zval(op2, &op2_copy, &use_copy2);
if (use_copy1) {
op1 = &op1_copy;
op2 = &op2_copy;
}
- if (UG(unicode)) {
- Z_LVAL_P(result) = ucol_strcoll(UG(default_collator)->coll, Z_USTRVAL_P(op1), Z_USTRLEN_P(op1), Z_USTRVAL_P(op2), Z_USTRLEN_P(op2));
- } else {
- Z_LVAL_P(result) = strcoll(Z_STRVAL_P(op1), Z_STRVAL_P(op2));
- }
+ Z_LVAL_P(result) = ucol_strcoll(UG(default_collator)->coll, Z_USTRVAL_P(op1), Z_USTRLEN_P(op1), Z_USTRVAL_P(op2), Z_USTRLEN_P(op2));
Z_TYPE_P(result) = IS_LONG;
if (use_copy1) {
#define convert_to_string_with_converter(op, conv) _convert_to_string_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC)
#define convert_to_unicode(op) _convert_to_unicode((op) TSRMLS_CC ZEND_FILE_LINE_CC)
#define convert_to_unicode_with_converter(op, conv) _convert_to_unicode_with_converter((op), (conv) TSRMLS_CC ZEND_FILE_LINE_CC)
-#define convert_to_text(op) (UG(unicode)?convert_to_unicode(op):convert_to_string(op))
+#define convert_to_text(op) convert_to_unicode(op)
ZEND_API double zend_string_to_double(const char *number, zend_uint length);
#define convert_to_array_ex(ppzv) convert_to_ex_master(ppzv, array, ARRAY)
#define convert_to_object_ex(ppzv) convert_to_ex_master(ppzv, object, OBJECT)
#define convert_to_null_ex(ppzv) convert_to_ex_master(ppzv, null, NULL)
-#define convert_to_text_ex(ppzv) if (UG(unicode)) {convert_to_unicode_ex(ppzv);} else {convert_to_string_ex(ppzv);}
+#define convert_to_text_ex(ppzv) convert_to_unicode_ex(ppzv);
#define convert_to_string_with_converter_ex(ppzv, conv) \
if (Z_TYPE_PP(ppzv) != IS_STRING) { \
#define USTR_FREE(ustr) do { if (ustr) { efree(ustr); } } while (0);
#define UBYTES(len) ((len) * sizeof(UChar))
-#define USTR_LEN(str) (UG(unicode)?u_strlen((str).u):strlen((str).s))
-#define USTR_VAL(str) (UG(unicode)?(str).u:(str).s)
+#define USTR_LEN(str) u_strlen((str).u)
+#define USTR_VAL(str) (str).u
#define USTR_BYTES(__type, __length) \
((__type == IS_UNICODE)?UBYTES(__length):__length)
#define TEXT_BYTES(__chars_len) \
- (UG(unicode) ? UBYTES(__chars_len) : __chars_len)
+ UBYTES(__chars_len)
#define TEXT_CHARS(__bytes_len) \
- (UG(unicode) ? (__bytes_len / sizeof(UChar)) : __bytes_len)
+ (__bytes_len / sizeof(UChar))
#define USTR_MAKE(cs) zend_ascii_to_unicode(cs, sizeof(cs) ZEND_FILE_LINE_CC)
#define USTR_MAKE_REL(cs) zend_ascii_to_unicode(cs, sizeof(cs) ZEND_FILE_LINE_RELAY_CC)
{
switch (Z_TYPE_P(zvalue) & IS_CONSTANT_TYPE_MASK) {
case IS_CONSTANT: {
- TSRMLS_FETCH();
-
- if (UG(unicode)) goto dtor_unicode;
+ goto dtor_unicode;
}
case IS_STRING:
CHECK_ZVAL_STRING_REL(zvalue);
{
switch (Z_TYPE_P(zvalue) & IS_CONSTANT_TYPE_MASK) {
case IS_CONSTANT: {
- TSRMLS_FETCH();
-
- if (UG(unicode)) goto dtor_unicode;
+ goto dtor_unicode;
}
case IS_STRING:
CHECK_ZVAL_STRING_REL(zvalue);
case IS_NULL:
break;
case IS_CONSTANT: {
- TSRMLS_FETCH();
-
- if (UG(unicode)) goto copy_unicode;
+ goto copy_unicode;
}
case IS_STRING:
CHECK_ZVAL_STRING_REL(zvalue);
zval_dtor(&z_conv);
ucnv_close(script_enc_conv);
} else if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, ZEND_STR_TYPE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_UNICODE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
Z_TYPE_P(varname) != IS_UNICODE) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
- convert_to_text(&tmp_varname);
+ convert_to_unicode(&tmp_varname);
varname = &tmp_varname;
}
int function_name_strlen;
zend_free_op free_op1, free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
*EX(CVs)[opline->op2.u.var] = EG(exception);
} else {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.u.var);
- zend_u_hash_quick_update(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value,
+ zend_u_hash_quick_update(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value,
&EG(exception), sizeof(zval *), (void**)&EX(CVs)[opline->op2.u.var]);
}
EG(exception) = NULL;
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zval tmp_inc_filename;
zend_bool failure_retval=0;
- if (UG(unicode) && Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
+ if (Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
if (Z_TYPE_P(inc_filename) != IS_UNICODE) {
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
zend_execute_data *ex = EX(prev_execute_data);
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_del(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
+ if (zend_u_hash_quick_del(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
int i;
for (i = 0; i < ex->op_array->last_var; i++) {
if (ex->op_array->vars[i].hash_value == cv->hash_value &&
ex->op_array->vars[i].name_len == cv->name_len &&
- !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(ZEND_STR_TYPE, cv->name_len))) {
+ !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(IS_UNICODE, cv->name_len))) {
ex->CVs[i] = NULL;
break;
}
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
} else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
Z_ADDREF_P(varname);
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
} else if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_find(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
+ if (zend_u_hash_quick_find(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
}
} else {
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
}
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
ZEND_VM_HANDLER(151, ZEND_U_NORMALIZE, CONST|TMP|VAR|CV, ANY)
{
+ zval var_copy;
+ int use_copy;
+ UChar *norm;
+ int norm_len;
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval *string = GET_OP1_ZVAL_PTR(BP_VAR_R);
zendi_zval_copy_ctor(*result);
}
- if (UG(unicode)) {
- zval var_copy;
- int use_copy;
- UChar *norm;
- int norm_len;
-
- zend_make_unicode_zval(result, &var_copy, &use_copy);
- if (use_copy) {
- zval_dtor(result);
- *result = var_copy;
- }
- if (zend_normalize_identifier(&norm, &norm_len,
- Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
- zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
- } else if (norm != Z_USTRVAL_P(result)) {
- efree(Z_USTRVAL_P(result));
- ZVAL_UNICODEL(result, norm, norm_len, 0);
- }
+ zend_make_unicode_zval(result, &var_copy, &use_copy);
+ if (use_copy) {
+ zval_dtor(result);
+ *result = var_copy;
}
+ if (zend_normalize_identifier(&norm, &norm_len,
+ Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
+ zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
+ } else if (norm != Z_USTRVAL_P(result)) {
+ efree(Z_USTRVAL_P(result));
+ ZVAL_UNICODEL(result, norm, norm_len, 0);
+ }
+
FREE_OP1_IF_VAR();
ZEND_VM_NEXT_OPCODE();
}
zend_op *opline = EX(opline);
zend_op_array *op_array;
- if (zend_u_hash_quick_find(EG(function_table), UG(unicode)?IS_UNICODE:IS_STRING, Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), Z_LVAL(opline->op2.u.constant), (void *) &op_array) == FAILURE ||
+ if (zend_u_hash_quick_find(EG(function_table), IS_UNICODE, Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), Z_LVAL(opline->op2.u.constant), (void *) &op_array) == FAILURE ||
op_array->type != ZEND_USER_FUNCTION) {
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
}
*EX(CVs)[opline->op2.u.var] = EG(exception);
} else {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.u.var);
- zend_u_hash_quick_update(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value,
+ zend_u_hash_quick_update(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value,
&EG(exception), sizeof(zval *), (void**)&EX(CVs)[opline->op2.u.var]);
}
EG(exception) = NULL;
zval_dtor(&z_conv);
ucnv_close(script_enc_conv);
} else if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, ZEND_STR_TYPE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_UNICODE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
Z_TYPE_P(varname) != IS_UNICODE) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
- convert_to_text(&tmp_varname);
+ convert_to_unicode(&tmp_varname);
varname = &tmp_varname;
}
zval tmp_inc_filename;
zend_bool failure_retval=0;
- if (UG(unicode) && Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
+ if (Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
if (Z_TYPE_P(inc_filename) != IS_UNICODE) {
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
zend_execute_data *ex = EX(prev_execute_data);
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_del(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
+ if (zend_u_hash_quick_del(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
int i;
for (i = 0; i < ex->op_array->last_var; i++) {
if (ex->op_array->vars[i].hash_value == cv->hash_value &&
ex->op_array->vars[i].name_len == cv->name_len &&
- !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(ZEND_STR_TYPE, cv->name_len))) {
+ !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(IS_UNICODE, cv->name_len))) {
ex->CVs[i] = NULL;
break;
}
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
Z_ADDREF_P(varname);
} else if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_find(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
+ if (zend_u_hash_quick_find(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
}
} else {
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
}
static int ZEND_FASTCALL ZEND_U_NORMALIZE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval var_copy;
+ int use_copy;
+ UChar *norm;
+ int norm_len;
zend_op *opline = EX(opline);
zval *string = &opline->op1.u.constant;
zendi_zval_copy_ctor(*result);
}
- if (UG(unicode)) {
- zval var_copy;
- int use_copy;
- UChar *norm;
- int norm_len;
-
- zend_make_unicode_zval(result, &var_copy, &use_copy);
- if (use_copy) {
- zval_dtor(result);
- *result = var_copy;
- }
- if (zend_normalize_identifier(&norm, &norm_len,
- Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
- zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
- } else if (norm != Z_USTRVAL_P(result)) {
- efree(Z_USTRVAL_P(result));
- ZVAL_UNICODEL(result, norm, norm_len, 0);
- }
+ zend_make_unicode_zval(result, &var_copy, &use_copy);
+ if (use_copy) {
+ zval_dtor(result);
+ *result = var_copy;
+ }
+ if (zend_normalize_identifier(&norm, &norm_len,
+ Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
+ zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
+ } else if (norm != Z_USTRVAL_P(result)) {
+ efree(Z_USTRVAL_P(result));
+ ZVAL_UNICODEL(result, norm, norm_len, 0);
}
ZEND_VM_NEXT_OPCODE();
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zend_op *opline = EX(opline);
zend_op_array *op_array;
- if (zend_u_hash_quick_find(EG(function_table), UG(unicode)?IS_UNICODE:IS_STRING, Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), Z_LVAL(opline->op2.u.constant), (void *) &op_array) == FAILURE ||
+ if (zend_u_hash_quick_find(EG(function_table), IS_UNICODE, Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), Z_LVAL(opline->op2.u.constant), (void *) &op_array) == FAILURE ||
op_array->type != ZEND_USER_FUNCTION) {
zend_error_noreturn(E_ERROR, "Base lambda function for closure not found");
}
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zval_dtor(&z_conv);
ucnv_close(script_enc_conv);
} else if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, ZEND_STR_TYPE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_UNICODE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
Z_TYPE_P(varname) != IS_UNICODE) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
- convert_to_text(&tmp_varname);
+ convert_to_unicode(&tmp_varname);
varname = &tmp_varname;
}
zval tmp_inc_filename;
zend_bool failure_retval=0;
- if (UG(unicode) && Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
+ if (Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
if (Z_TYPE_P(inc_filename) != IS_UNICODE) {
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
zend_execute_data *ex = EX(prev_execute_data);
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_del(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
+ if (zend_u_hash_quick_del(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
int i;
for (i = 0; i < ex->op_array->last_var; i++) {
if (ex->op_array->vars[i].hash_value == cv->hash_value &&
ex->op_array->vars[i].name_len == cv->name_len &&
- !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(ZEND_STR_TYPE, cv->name_len))) {
+ !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(IS_UNICODE, cv->name_len))) {
ex->CVs[i] = NULL;
break;
}
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(varname);
} else if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_find(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
+ if (zend_u_hash_quick_find(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
}
} else {
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
}
static int ZEND_FASTCALL ZEND_U_NORMALIZE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval var_copy;
+ int use_copy;
+ UChar *norm;
+ int norm_len;
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval *string = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zendi_zval_copy_ctor(*result);
}
- if (UG(unicode)) {
- zval var_copy;
- int use_copy;
- UChar *norm;
- int norm_len;
-
- zend_make_unicode_zval(result, &var_copy, &use_copy);
- if (use_copy) {
- zval_dtor(result);
- *result = var_copy;
- }
- if (zend_normalize_identifier(&norm, &norm_len,
- Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
- zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
- } else if (norm != Z_USTRVAL_P(result)) {
- efree(Z_USTRVAL_P(result));
- ZVAL_UNICODEL(result, norm, norm_len, 0);
- }
+ zend_make_unicode_zval(result, &var_copy, &use_copy);
+ if (use_copy) {
+ zval_dtor(result);
+ *result = var_copy;
+ }
+ if (zend_normalize_identifier(&norm, &norm_len,
+ Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
+ zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
+ } else if (norm != Z_USTRVAL_P(result)) {
+ efree(Z_USTRVAL_P(result));
+ ZVAL_UNICODEL(result, norm, norm_len, 0);
}
ZEND_VM_NEXT_OPCODE();
int function_name_strlen;
zend_free_op free_op1;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int function_name_strlen;
zend_free_op free_op1, free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int function_name_strlen;
zend_free_op free_op1, free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int function_name_strlen;
zend_free_op free_op1;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
zval_dtor(&z_conv);
ucnv_close(script_enc_conv);
} else if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, ZEND_STR_TYPE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_UNICODE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
Z_TYPE_P(varname) != IS_UNICODE) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
- convert_to_text(&tmp_varname);
+ convert_to_unicode(&tmp_varname);
varname = &tmp_varname;
}
zval tmp_inc_filename;
zend_bool failure_retval=0;
- if (UG(unicode) && Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
+ if (Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
if (Z_TYPE_P(inc_filename) != IS_UNICODE) {
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
zend_execute_data *ex = EX(prev_execute_data);
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_del(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
+ if (zend_u_hash_quick_del(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
int i;
for (i = 0; i < ex->op_array->last_var; i++) {
if (ex->op_array->vars[i].hash_value == cv->hash_value &&
ex->op_array->vars[i].name_len == cv->name_len &&
- !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(ZEND_STR_TYPE, cv->name_len))) {
+ !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(IS_UNICODE, cv->name_len))) {
ex->CVs[i] = NULL;
break;
}
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
Z_ADDREF_P(varname);
} else if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_find(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
+ if (zend_u_hash_quick_find(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
}
} else {
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
}
static int ZEND_FASTCALL ZEND_U_NORMALIZE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval var_copy;
+ int use_copy;
+ UChar *norm;
+ int norm_len;
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval *string = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zendi_zval_copy_ctor(*result);
}
- if (UG(unicode)) {
- zval var_copy;
- int use_copy;
- UChar *norm;
- int norm_len;
-
- zend_make_unicode_zval(result, &var_copy, &use_copy);
- if (use_copy) {
- zval_dtor(result);
- *result = var_copy;
- }
- if (zend_normalize_identifier(&norm, &norm_len,
- Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
- zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
- } else if (norm != Z_USTRVAL_P(result)) {
- efree(Z_USTRVAL_P(result));
- ZVAL_UNICODEL(result, norm, norm_len, 0);
- }
+ zend_make_unicode_zval(result, &var_copy, &use_copy);
+ if (use_copy) {
+ zval_dtor(result);
+ *result = var_copy;
+ }
+ if (zend_normalize_identifier(&norm, &norm_len,
+ Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
+ zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
+ } else if (norm != Z_USTRVAL_P(result)) {
+ efree(Z_USTRVAL_P(result));
+ ZVAL_UNICODEL(result, norm, norm_len, 0);
}
+
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
}
int function_name_strlen;
zend_free_op free_op1;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
zend_free_op free_op1, free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
zend_free_op free_op1, free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int function_name_strlen;
zend_free_op free_op1;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
zend_free_op free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
zend_free_op free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
zval_dtor(&z_conv);
ucnv_close(script_enc_conv);
} else if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL &&
- zend_std_cast_object_tostring(z, &z_copy, ZEND_STR_TYPE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
+ zend_std_cast_object_tostring(z, &z_copy, IS_UNICODE, ZEND_U_CONVERTER(UG(output_encoding_conv)) TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
Z_TYPE_P(varname) != IS_UNICODE) {
tmp_varname = *varname;
zval_copy_ctor(&tmp_varname);
- convert_to_text(&tmp_varname);
+ convert_to_unicode(&tmp_varname);
varname = &tmp_varname;
}
zval tmp_inc_filename;
zend_bool failure_retval=0;
- if (UG(unicode) && Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
+ if (Z_LVAL(opline->op2.u.constant) == ZEND_EVAL) {
if (Z_TYPE_P(inc_filename) != IS_UNICODE) {
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
zend_execute_data *ex = EX(prev_execute_data);
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_del(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
+ if (zend_u_hash_quick_del(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value) == SUCCESS) {
while (ex && ex->symbol_table == EG(active_symbol_table)) {
int i;
for (i = 0; i < ex->op_array->last_var; i++) {
if (ex->op_array->vars[i].hash_value == cv->hash_value &&
ex->op_array->vars[i].name_len == cv->name_len &&
- !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(ZEND_STR_TYPE, cv->name_len))) {
+ !memcmp(ex->op_array->vars[i].name.v, cv->name.v, USTR_BYTES(IS_UNICODE, cv->name_len))) {
ex->CVs[i] = NULL;
break;
}
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
Z_ADDREF_P(varname);
} else if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.u.var);
- if (zend_u_hash_quick_find(EG(active_symbol_table), ZEND_STR_TYPE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
+ if (zend_u_hash_quick_find(EG(active_symbol_table), IS_UNICODE, cv->name, cv->name_len+1, cv->hash_value, (void **) &value) == FAILURE) {
isset = 0;
}
} else {
if (Z_TYPE_P(varname) != IS_STRING && Z_TYPE_P(varname) != IS_UNICODE) {
tmp = *varname;
zval_copy_ctor(&tmp);
- convert_to_text(&tmp);
+ convert_to_unicode(&tmp);
varname = &tmp;
}
static int ZEND_FASTCALL ZEND_U_NORMALIZE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval var_copy;
+ int use_copy;
+ UChar *norm;
+ int norm_len;
zend_op *opline = EX(opline);
zval *string = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zendi_zval_copy_ctor(*result);
}
- if (UG(unicode)) {
- zval var_copy;
- int use_copy;
- UChar *norm;
- int norm_len;
-
- zend_make_unicode_zval(result, &var_copy, &use_copy);
- if (use_copy) {
- zval_dtor(result);
- *result = var_copy;
- }
- if (zend_normalize_identifier(&norm, &norm_len,
- Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
- zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
- } else if (norm != Z_USTRVAL_P(result)) {
- efree(Z_USTRVAL_P(result));
- ZVAL_UNICODEL(result, norm, norm_len, 0);
- }
+ zend_make_unicode_zval(result, &var_copy, &use_copy);
+ if (use_copy) {
+ zval_dtor(result);
+ *result = var_copy;
+ }
+ if (zend_normalize_identifier(&norm, &norm_len,
+ Z_USTRVAL_P(result), Z_USTRLEN_P(result), 0) == FAILURE) {
+ zend_error(E_WARNING, "Could not normalize identifier: %r", Z_USTRVAL_P(result));
+ } else if (norm != Z_USTRVAL_P(result)) {
+ efree(Z_USTRVAL_P(result));
+ ZVAL_UNICODEL(result, norm, norm_len, 0);
}
ZEND_VM_NEXT_OPCODE();
int function_name_strlen;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
zend_free_op free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
int function_name_strlen;
zend_free_op free_op2;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int function_name_strlen;
/* FIXME: type is default */
- zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar type = IS_UNICODE;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
zend_u_symtable_update(Z_ARRVAL_P(array_ptr), Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, &expr_ptr, sizeof(zval *), NULL);
break;
case IS_NULL:
- zend_u_hash_update(Z_ARRVAL_P(array_ptr), ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(array_ptr), IS_UNICODE, EMPTY_ZSTR, sizeof(""), &expr_ptr, sizeof(zval *), NULL);
break;
default:
zend_error(E_WARNING, "Illegal offset type");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- zend_u_hash_del(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""));
+ zend_u_hash_del(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
int offset_len = Z_UNILEN_P(offset);
int free_offset = 0;
- if (UG(unicode) && ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
+ if (ht == &EG(symbol_table) && Z_TYPE_P(offset) == IS_UNICODE) {
/* Identifier normalization */
UChar *norm;
int norm_len;
break;
}
case IS_NULL:
- if (zend_u_hash_find(ht, ZEND_STR_TYPE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
+ if (zend_u_hash_find(ht, IS_UNICODE, EMPTY_ZSTR, sizeof(""), (void **) &value) == SUCCESS) {
isset = 1;
}
break;
efree(yearp);
}
- if (UG(unicode) && CALENDAR_G(iso_8859_8_conv)) {
+ if (CALENDAR_G(iso_8859_8_conv)) {
RETURN_U_STRING(CALENDAR_G(iso_8859_8_conv), hebdate, ZSTR_DUPLICATE);
} else {
RETURN_STRING(hebdate, 1);
case CAL_MONTH_JEWISH: /* jewish month */
SdnToJewish(julday, &year, &month, &day);
monthname = JewishMonthName[month];
- if (UG(unicode) && CALENDAR_G(iso_8859_8_conv)) {
+ if (CALENDAR_G(iso_8859_8_conv)) {
RETURN_U_STRING(CALENDAR_G(iso_8859_8_conv), monthname, ZSTR_DUPLICATE);
} else {
RETURN_STRING(monthname, 1);
break;
case VT_BSTR:
if (V_BSTR(v)) {
- if (UG(unicode)) {
- ZVAL_UNICODE(z, V_BSTR(v), 1);
- } else {
- Z_TYPE_P(z) = IS_STRING;
- Z_STRVAL_P(z) = php_com_olestring_to_string(V_BSTR(v),
- &Z_STRLEN_P(z), codepage TSRMLS_CC);
- }
+ ZVAL_UNICODE(z, V_BSTR(v), 1);
}
break;
case VT_UNKNOWN:
va_start(ap, format);
- if (UG(unicode)) {
- c = vuspprintf((UChar**)str, size, format, ap) * sizeof(UChar);
- } else {
- c = vspprintf(str, size, format, ap);
- }
+ c = vuspprintf((UChar**)str, size, format, ap) * sizeof(UChar);
va_end(ap);
return c;
}
if (!format_len) {
*return_len = 0;
- if (UG(unicode)) {
- return (char*)eustrdup(EMPTY_STR);
- } else {
- return estrdup("");
- }
+ return (char*)eustrdup(EMPTY_STR);
}
loc_dat = date_get_locale_data(UG(default_locale));
timelib_time_offset_dtor(offset);
}
- if (UG(unicode)) {
- *return_len = string.len / 2;
- } else {
- *return_len = string.len;
- }
+ *return_len = string.len / 2;
return string.c;
}
string = php_format_date(format, format_len, ts, localtime TSRMLS_CC);
- if (UG(unicode)) {
- RETVAL_UNICODE((UChar*)string, 0);
- } else {
- RETVAL_STRING(string, 0);
- }
+ RETVAL_UNICODE((UChar*)string, 0);
}
/* }}} */
if (real_len && real_len != buf_len) {
buf = (char *) erealloc(buf, real_len + 1);
- if (UG(unicode)) {
- RETVAL_RT_STRINGL(buf, real_len, 1);
- efree(buf);
- return;
- } else {
- RETURN_STRINGL(buf, real_len, 0);
- }
+ RETVAL_RT_STRINGL(buf, real_len, 1);
+ efree(buf);
+ return;
}
efree(buf);
RETURN_FALSE;
/* first we add the date and time in ISO format */
str = date_format("Y-m-d H:i:s", 12, &return_len, dateobj->time, 1, 0 TSRMLS_CC);
MAKE_STD_ZVAL(zv);
- if (UG(unicode)) {
- ZVAL_UNICODEL(zv, (UChar*) str, return_len - 1, 0);
- } else {
- ZVAL_STRINGL(zv, str, return_len - 1, 0);
- }
+ ZVAL_UNICODEL(zv, (UChar*) str, return_len - 1, 0);
zend_hash_update(props, "date", 5, &zv, sizeof(zval), NULL);
/* then we add the timezone name (or similar) */
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
str = date_format(format, format_len, &length, dateobj->time, dateobj->time->is_localtime, 0 TSRMLS_CC);
- if (UG(unicode)) {
- RETURN_UNICODEL((UChar*) str, length, 0);
- } else {
- RETURN_STRINGL(str, length, 0);
- }
+ RETURN_UNICODEL((UChar*) str, length, 0);
}
/* }}} */
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
str = date_format(format, format_len, &length, dateobj->time, dateobj->time->is_localtime, 1 TSRMLS_CC);
- if (UG(unicode)) {
- RETURN_UNICODEL((UChar*)str, length, 0);
- } else {
- RETURN_STRINGL(str, length, 0);
- }
+ RETURN_UNICODEL((UChar*)str, length, 0);
}
/* }}} */
MAKE_STD_ZVAL(element); \
array_init(element); \
add_ascii_assoc_long(element, "ts", timestamp_begin); \
- if (UG(unicode)) { \
- add_ascii_assoc_unicode(element, "time", (UChar*) php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0 TSRMLS_CC), 0); \
- } else { \
- add_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0 TSRMLS_CC), 0); \
- } \
+ add_ascii_assoc_unicode(element, "time", (UChar*) php_format_date(DATE_FORMAT_ISO8601, 13, timestamp_begin, 0 TSRMLS_CC), 0); \
add_ascii_assoc_long(element, "offset", tzobj->tzi.tz->type[0].offset); \
add_ascii_assoc_bool(element, "isdst", tzobj->tzi.tz->type[0].isdst); \
add_ascii_assoc_ascii_string(element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx], 1); \
MAKE_STD_ZVAL(element); \
array_init(element); \
add_ascii_assoc_long(element, "ts", ts); \
- if (UG(unicode)) { \
- add_ascii_assoc_unicode(element, "time", (UChar*) php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0 TSRMLS_CC), 0); \
- } else { \
- add_assoc_string(element, "time", php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0 TSRMLS_CC), 0); \
- } \
+ add_ascii_assoc_unicode(element, "time", (UChar*) php_format_date(DATE_FORMAT_ISO8601, 13, ts, 0 TSRMLS_CC), 0); \
add_ascii_assoc_long(element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \
add_ascii_assoc_bool(element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \
add_ascii_assoc_ascii_string(element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].abbr_idx], 1); \
zend_u_hash_init(doc_props->classmap, 0, NULL, NULL, 0, UG(unicode));
}
if (ce) {
- return zend_u_hash_update(doc_props->classmap, UG(unicode)?IS_UNICODE:IS_STRING, basece->name, basece->name_length + 1, &ce, sizeof(ce), NULL);
+ return zend_u_hash_update(doc_props->classmap, IS_UNICODE, basece->name, basece->name_length + 1, &ce, sizeof(ce), NULL);
} else {
- zend_u_hash_del(doc_props->classmap, UG(unicode)?IS_UNICODE:IS_STRING, basece->name, basece->name_length + 1);
+ zend_u_hash_del(doc_props->classmap, IS_UNICODE, basece->name, basece->name_length + 1);
}
}
return SUCCESS;
if (document) {
doc_props = dom_get_doc_props(document);
if (doc_props->classmap) {
- if (zend_u_hash_find(doc_props->classmap, UG(unicode)?IS_UNICODE:IS_STRING, basece->name, basece->name_length + 1, (void**) &ce) == SUCCESS) {
+ if (zend_u_hash_find(doc_props->classmap, IS_UNICODE, basece->name, basece->name_length + 1, (void**) &ce) == SUCCESS) {
return *ce;
}
}
if (member->type != IS_STRING && member->type != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
if (member->type != IS_STRING && member->type != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
if (member->type != IS_STRING && member->type != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
if (member->type != IS_STRING && member->type != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
zend_hash_init(&dom_domstringlist_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_domstringlist_prop_handlers, "length", dom_domstringlist_length_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_domstringlist_prop_handlers, sizeof(dom_domstringlist_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_domstringlist_prop_handlers, sizeof(dom_domstringlist_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMNameList", NULL, php_dom_namelist_class_functions, dom_namelist_class_entry);
zend_hash_init(&dom_namelist_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_namelist_prop_handlers, "length", dom_namelist_length_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_namelist_prop_handlers, sizeof(dom_namelist_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_namelist_prop_handlers, sizeof(dom_namelist_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMImplementationList", NULL, php_dom_domimplementationlist_class_functions, dom_domimplementationlist_class_entry);
zend_hash_init(&dom_domimplementationlist_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_domimplementationlist_prop_handlers, "length", dom_domimplementationlist_length_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_domimplementationlist_prop_handlers, sizeof(dom_domimplementationlist_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_domimplementationlist_prop_handlers, sizeof(dom_domimplementationlist_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMImplementationSource", NULL, php_dom_domimplementationsource_class_functions, dom_domimplementationsource_class_entry);
REGISTER_DOM_CLASS(ce, "DOMImplementation", NULL, php_dom_domimplementation_class_functions, dom_domimplementation_class_entry);
dom_register_prop_handler(&dom_node_prop_handlers, "localName", dom_node_local_name_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_node_prop_handlers, "baseURI", dom_node_base_uri_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_node_prop_handlers, "textContent", dom_node_text_content_read, dom_node_text_content_write TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_node_prop_handlers, sizeof(dom_node_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_node_prop_handlers, sizeof(dom_node_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMNameSpaceNode", NULL, NULL, dom_namespace_node_class_entry);
dom_register_prop_handler(&dom_namespace_node_prop_handlers, "namespaceURI", dom_node_namespace_uri_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_namespace_node_prop_handlers, "ownerDocument", dom_node_owner_document_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_namespace_node_prop_handlers, "parentNode", dom_node_parent_node_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_namespace_node_prop_handlers, sizeof(dom_namespace_node_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_namespace_node_prop_handlers, sizeof(dom_namespace_node_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMDocumentFragment", dom_node_class_entry, php_dom_documentfragment_class_functions, dom_documentfragment_class_entry);
zend_hash_init(&dom_document_fragment_prop_handlers, 0, NULL, NULL, 1);
zend_hash_copy(&dom_document_fragment_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler));
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_document_fragment_prop_handlers, sizeof(dom_node_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_document_fragment_prop_handlers, sizeof(dom_node_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMDocument", dom_node_class_entry, php_dom_document_class_functions, dom_document_class_entry);
zend_hash_init(&dom_document_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_document_prop_handlers, "substituteEntities", dom_document_substitue_entities_read, dom_document_substitue_entities_write TSRMLS_CC);
zend_hash_merge(&dom_document_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_document_prop_handlers, sizeof(dom_document_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_document_prop_handlers, sizeof(dom_document_prop_handlers), NULL);
INIT_CLASS_ENTRY(ce, "DOMNodeList", php_dom_nodelist_class_functions);
ce.create_object = dom_nnodemap_objects_new;
zend_hash_init(&dom_nodelist_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_nodelist_prop_handlers, "length", dom_nodelist_length_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_nodelist_prop_handlers, sizeof(dom_nodelist_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_nodelist_prop_handlers, sizeof(dom_nodelist_prop_handlers), NULL);
INIT_CLASS_ENTRY(ce, "DOMNamedNodeMap", php_dom_namednodemap_class_functions);
ce.create_object = dom_nnodemap_objects_new;
zend_hash_init(&dom_namednodemap_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_namednodemap_prop_handlers, "length", dom_namednodemap_length_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_namednodemap_prop_handlers, sizeof(dom_namednodemap_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_namednodemap_prop_handlers, sizeof(dom_namednodemap_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMCharacterData", dom_node_class_entry, php_dom_characterdata_class_functions, dom_characterdata_class_entry);
dom_register_prop_handler(&dom_characterdata_prop_handlers, "data", dom_characterdata_data_read, dom_characterdata_data_write TSRMLS_CC);
dom_register_prop_handler(&dom_characterdata_prop_handlers, "length", dom_characterdata_length_read, NULL TSRMLS_CC);
zend_hash_merge(&dom_characterdata_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_characterdata_prop_handlers, sizeof(dom_characterdata_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_characterdata_prop_handlers, sizeof(dom_characterdata_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMAttr", dom_node_class_entry, php_dom_attr_class_functions, dom_attr_class_entry);
dom_register_prop_handler(&dom_attr_prop_handlers, "ownerElement", dom_attr_owner_element_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_attr_prop_handlers, "schemaTypeInfo", dom_attr_schema_type_info_read, NULL TSRMLS_CC);
zend_hash_merge(&dom_attr_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_attr_prop_handlers, sizeof(dom_attr_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_attr_prop_handlers, sizeof(dom_attr_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMElement", dom_node_class_entry, php_dom_element_class_functions, dom_element_class_entry);
dom_register_prop_handler(&dom_element_prop_handlers, "tagName", dom_element_tag_name_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_element_prop_handlers, "schemaTypeInfo", dom_element_schema_type_info_read, NULL TSRMLS_CC);
zend_hash_merge(&dom_element_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_element_prop_handlers, sizeof(dom_element_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_element_prop_handlers, sizeof(dom_element_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMText", dom_characterdata_class_entry, php_dom_text_class_functions, dom_text_class_entry);
zend_hash_init(&dom_text_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_text_prop_handlers, "wholeText", dom_text_whole_text_read, NULL TSRMLS_CC);
zend_hash_merge(&dom_text_prop_handlers, &dom_characterdata_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_text_prop_handlers, sizeof(dom_text_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_text_prop_handlers, sizeof(dom_text_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMComment", dom_characterdata_class_entry, php_dom_comment_class_functions, dom_comment_class_entry);
zend_hash_init(&dom_comment_prop_handlers, 0, NULL, NULL, 1);
zend_hash_copy(&dom_comment_prop_handlers, &dom_characterdata_prop_handlers, NULL, NULL, sizeof(dom_prop_handler));
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_comment_prop_handlers, sizeof(dom_comment_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_comment_prop_handlers, sizeof(dom_comment_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMTypeinfo", NULL, php_dom_typeinfo_class_functions, dom_typeinfo_class_entry);
zend_hash_init(&dom_typeinfo_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeName", dom_typeinfo_type_name_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_typeinfo_prop_handlers, "typeNamespace", dom_typeinfo_type_namespace_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_typeinfo_prop_handlers, sizeof(dom_typeinfo_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_typeinfo_prop_handlers, sizeof(dom_typeinfo_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMUserDataHandler", NULL, php_dom_userdatahandler_class_functions, dom_userdatahandler_class_entry);
REGISTER_DOM_CLASS(ce, "DOMDomError", NULL, php_dom_domerror_class_functions, dom_domerror_class_entry);
dom_register_prop_handler(&dom_domerror_prop_handlers, "relatedException", dom_domerror_related_exception_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_domerror_prop_handlers, "related_data", dom_domerror_related_data_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_domerror_prop_handlers, "location", dom_domerror_location_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_domerror_prop_handlers, sizeof(dom_domerror_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_domerror_prop_handlers, sizeof(dom_domerror_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMErrorHandler", NULL, php_dom_domerrorhandler_class_functions, dom_domerrorhandler_class_entry);
REGISTER_DOM_CLASS(ce, "DOMLocator", NULL, php_dom_domlocator_class_functions, dom_domlocator_class_entry);
dom_register_prop_handler(&dom_domlocator_prop_handlers, "offset", dom_domlocator_offset_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_domlocator_prop_handlers, "relatedNode", dom_domlocator_related_node_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_domlocator_prop_handlers, "uri", dom_domlocator_uri_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_domlocator_prop_handlers, sizeof(dom_domlocator_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_domlocator_prop_handlers, sizeof(dom_domlocator_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMConfiguration", NULL, php_dom_domconfiguration_class_functions, dom_domconfiguration_class_entry);
REGISTER_DOM_CLASS(ce, "DOMCdataSection", dom_text_class_entry, php_dom_cdatasection_class_functions, dom_cdatasection_class_entry);
zend_hash_init(&dom_cdata_prop_handlers, 0, NULL, NULL, 1);
zend_hash_copy(&dom_cdata_prop_handlers, &dom_text_prop_handlers, NULL, NULL, sizeof(dom_prop_handler));
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_cdata_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_cdata_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMDocumentType", dom_node_class_entry, php_dom_documenttype_class_functions, dom_documenttype_class_entry);
dom_register_prop_handler(&dom_documenttype_prop_handlers, "systemId", dom_documenttype_system_id_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_documenttype_prop_handlers, "internalSubset", dom_documenttype_internal_subset_read, NULL TSRMLS_CC);
zend_hash_merge(&dom_documenttype_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_documenttype_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_documenttype_prop_handlers, sizeof(dom_documenttype_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMNotation", NULL, php_dom_notation_class_functions, dom_notation_class_entry);
dom_register_prop_handler(&dom_notation_prop_handlers, "nodeName", dom_node_node_name_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_notation_prop_handlers, "nodeValue", dom_node_node_value_read, dom_node_node_value_write TSRMLS_CC);
dom_register_prop_handler(&dom_notation_prop_handlers, "attributes", dom_node_attributes_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_notation_prop_handlers, sizeof(dom_notation_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_notation_prop_handlers, sizeof(dom_notation_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMEntity", dom_node_class_entry, php_dom_entity_class_functions, dom_entity_class_entry);
dom_register_prop_handler(&dom_entity_prop_handlers, "version", dom_entity_version_read, dom_entity_version_write TSRMLS_CC);
zend_hash_merge(&dom_entity_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_entity_prop_handlers, sizeof(dom_entity_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_entity_prop_handlers, sizeof(dom_entity_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMEntityReference", dom_node_class_entry, php_dom_entityreference_class_functions, dom_entityreference_class_entry);
zend_hash_init(&dom_entity_reference_prop_handlers, 0, NULL, NULL, 1);
zend_hash_copy(&dom_entity_reference_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler));
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_entity_reference_prop_handlers, sizeof(dom_entity_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_entity_reference_prop_handlers, sizeof(dom_entity_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMProcessingInstruction", dom_node_class_entry, php_dom_processinginstruction_class_functions, dom_processinginstruction_class_entry);
dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "target", dom_processinginstruction_target_read, NULL TSRMLS_CC);
dom_register_prop_handler(&dom_processinginstruction_prop_handlers, "data", dom_processinginstruction_data_read, dom_processinginstruction_data_write TSRMLS_CC);
zend_hash_merge(&dom_processinginstruction_prop_handlers, &dom_node_prop_handlers, NULL, NULL, sizeof(dom_prop_handler), 0);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_processinginstruction_prop_handlers, sizeof(dom_processinginstruction_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_processinginstruction_prop_handlers, sizeof(dom_processinginstruction_prop_handlers), NULL);
REGISTER_DOM_CLASS(ce, "DOMStringExtend", NULL, php_dom_string_extend_class_functions, dom_string_extend_class_entry);
zend_hash_init(&dom_xpath_prop_handlers, 0, NULL, NULL, 1);
dom_register_prop_handler(&dom_xpath_prop_handlers, "document", dom_xpath_document_read, NULL TSRMLS_CC);
- zend_u_hash_add(&classes, ZEND_STR_TYPE, ce.name, ce.name_length + 1, &dom_xpath_prop_handlers, sizeof(dom_xpath_prop_handlers), NULL);
+ zend_u_hash_add(&classes, IS_UNICODE, ce.name, ce.name_length + 1, &dom_xpath_prop_handlers, sizeof(dom_xpath_prop_handlers), NULL);
#endif
REGISTER_LONG_CONSTANT("XML_ELEMENT_NODE", XML_ELEMENT_NODE, CONST_CS | CONST_PERSISTENT);
base_class = base_class->parent;
}
- zend_u_hash_find(&classes, UG(unicode)?IS_UNICODE:IS_STRING, base_class->name, base_class->name_length + 1, (void **) &intern->prop_handler);
+ zend_u_hash_find(&classes, IS_UNICODE, base_class->name, base_class->name_length + 1, (void **) &intern->prop_handler);
zend_object_std_init(&intern->std, class_type TSRMLS_CC);
if (hash_copy) {
#define RETVAL_FS_STRING(s, f) \
RETVAL_STRING((s), (f)); \
- if (UG(unicode)) { \
- zval_string_to_unicode_ex(return_value, ZEND_U_CONVERTER(UG(filesystem_encoding_conv)) TSRMLS_CC); \
- }
+ zval_string_to_unicode_ex(return_value, ZEND_U_CONVERTER(UG(filesystem_encoding_conv)) TSRMLS_CC);
+
#define RETURN_FS_STRING(s, f) \
RETVAL_FS_STRING((s), (f)); \
return;
return FAILURE;
}
- if (UG(unicode)) {
- output_encoding = INI_STR("unicode.output_encoding");
- if (output_encoding && *output_encoding && ucnv_compareNames(output_encoding, ICONVG(internal_encoding))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "unicode.output_encoding differs from iconv.internal_encoding (%s, %s)", output_encoding, ICONVG(internal_encoding));
- zend_alter_ini_entry(ZEND_STRS("iconv.internal_encoding"), output_encoding, strlen(output_encoding), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
- }
+ output_encoding = INI_STR("unicode.output_encoding");
+ if (output_encoding && *output_encoding && ucnv_compareNames(output_encoding, ICONVG(internal_encoding))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "unicode.output_encoding differs from iconv.internal_encoding (%s, %s)", output_encoding, ICONVG(internal_encoding));
+ zend_alter_ini_entry(ZEND_STRS("iconv.internal_encoding"), output_encoding, strlen(output_encoding), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
}
if (SG(sapi_headers).mimetype && !strncasecmp(SG(sapi_headers).mimetype, "text/", 5)) {
php_libxml_initialize();
export_hnd.export_func = export_function;
- return zend_u_hash_add(&php_libxml_exports, ZEND_STR_TYPE, ce->name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL);
+ return zend_u_hash_add(&php_libxml_exports, IS_UNICODE, ce->name, ce->name_length + 1, &export_hnd, sizeof(export_hnd), NULL);
}
PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC)
while (ce->parent != NULL) {
ce = ce->parent;
}
- if (zend_u_hash_find(&php_libxml_exports, UG(unicode)?IS_UNICODE:IS_STRING, ce->name, ce->name_length + 1, (void **) &export_hnd) == SUCCESS) {
+ if (zend_u_hash_find(&php_libxml_exports, IS_UNICODE, ce->name, ce->name_length + 1, (void **) &export_hnd) == SUCCESS) {
node = export_hnd->export_func(object TSRMLS_CC);
}
}
#define ZVAL_XML_STRING(z, s, flags) { \
UConverter *libxml_utf_conv = NULL; \
- if (UG(unicode)) { \
- libxml_utf_conv = UG(utf8_conv); \
- } \
+ libxml_utf_conv = UG(utf8_conv); \
ZVAL_U_STRING(libxml_utf_conv, z, s, flags); \
}
#define ZVAL_XML_STRING_LEN(z, s, l, flags) { \
UConverter *libxml_utf_conv = NULL; \
- if (UG(unicode)) { \
- libxml_utf_conv = UG(utf8_conv); \
- } \
+ libxml_utf_conv = UG(utf8_conv); \
ZVAL_U_STRINGL(libxml_utf_conv, z, s, l, flags); \
}
case OCI_SUCCESS_WITH_INFO:
errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %R", (UG(unicode) ? IS_UNICODE : IS_STRING), errbuf);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: %R", IS_UNICODE, errbuf);
efree(errbuf);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI_SUCCESS_WITH_INFO: failed to fetch error message");
case OCI_ERROR:
errcode = php_oci_fetch_errmsg(err_p, &errbuf TSRMLS_CC);
if (errbuf) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R", (UG(unicode) ? IS_UNICODE : IS_STRING), errbuf);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R", IS_UNICODE, errbuf);
efree(errbuf);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to fetch error message");
if (error_code) {
int err_buf_len;
- if (UG(unicode) && error_handle == OCI_G(err)) {
+ if (error_handle == OCI_G(err)) {
/* global err handle is not Unicode aware */
UChar *tmp_buf;
int tmp_buf_len;
efree(tmp_buf);
}
} else {
- if (UG(unicode)) {
- err_buf_len = u_strlen((UChar *)err_buf);
- if (err_buf_len && err_buf[UBYTES(err_buf_len - 1)] == '\n') { /* UTODO */
- err_buf[UBYTES(err_buf_len - 1)] = '\0';
- }
- } else {
- err_buf_len = strlen((char *)err_buf);
- if (err_buf_len && err_buf[err_buf_len - 1] == '\n') {
- err_buf[err_buf_len - 1] = '\0';
- }
+ err_buf_len = u_strlen((UChar *)err_buf);
+ if (err_buf_len && err_buf[UBYTES(err_buf_len - 1)] == '\n') { /* UTODO */
+ err_buf[UBYTES(err_buf_len - 1)] = '\0';
}
if (err_buf_len && error_buf) {
*sqltext = NULL_ZSTR;
*error_offset = 0;
- if (UG(unicode)) {
- PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) &(sqltext->u), (ub4 *)&sqltext_len, OCI_ATTR_STATEMENT, statement->err));
- } else {
- PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) &(sqltext->s), (ub4 *)&sqltext_len, OCI_ATTR_STATEMENT, statement->err));
- }
+ PHP_OCI_CALL_RETURN(statement->errcode, OCIAttrGet, ((dvoid *)statement->stmt, OCI_HTYPE_STMT, (dvoid *) &(sqltext->u), (ub4 *)&sqltext_len, OCI_ATTR_STATEMENT, statement->err));
if (statement->errcode != OCI_SUCCESS) {
statement->errcode = php_oci_error(statement->err, statement->errcode TSRMLS_CC);
*/
if ((session_mode & (OCI_SYSOPER | OCI_SYSDBA | PHP_OCI_CRED_EXT)) || (new_password_len)) {
use_spool = 0;
- } else if (UG(unicode)) {
+ } else {
/* Pre 10.1 session pool does not support unicode - bypass pool */
#ifndef HAVE_OCI_LOB_READ2 /* For finding 10.1+ client */
use_spool = 0;
/* DRCP: connection_class is an attribute of a connection */
if (OCI_G(connection_class)){
- smart_str_appendl_ex(&hashed_details, OCI_G(connection_class), (ub4)UG(unicode) ? USTR_BYTES(type, u_strlen((UChar *)OCI_G(connection_class))) : strlen(OCI_G(connection_class)), 0);
+ smart_str_appendl_ex(&hashed_details, OCI_G(connection_class), (ub4)USTR_BYTES(type, u_strlen((UChar *)OCI_G(connection_class))), 0);
}
smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0);
}
smart_str_appendl_ex(&hashed_details, "**", sizeof("**") - 1, 0);
- if (!UG(unicode)) {
- if (charset.s && *charset.s) {
- PHP_OCI_CALL_RETURN(charsetid, OCINlsCharSetNameToId, (OCI_G(env), (CONST oratext *)charset.s));
- if (!charsetid) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid character set name: %s", charset.s);
- } else {
- smart_str_append_unsigned_ex(&hashed_details, charsetid, 0);
- }
- }
-
- /* use NLS_LANG if no or invalid charset specified */
- if (!charsetid) {
- size_t rsize = 0;
- sword result;
-
- PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize));
- if (result != OCI_SUCCESS) {
- charsetid_nls_lang = 0;
- }
- smart_str_append_unsigned_ex(&hashed_details, charsetid_nls_lang, 0);
- }
- } else {
- charsetid = OCI_UTF16ID;
- smart_str_append_unsigned_ex(&hashed_details, charsetid, 0);
- }
+ charsetid = OCI_UTF16ID;
+ smart_str_append_unsigned_ex(&hashed_details, charsetid, 0);
timestamp = time(NULL);
return 1;
}
- if (UG(unicode)) {
- version->u = eustrdup((UChar *)version_buff);
- } else {
- version->s = estrdup(version_buff);
- }
+ version->u = eustrdup((UChar *)version_buff);
return 0;
} /* }}} */
if (fetch_mode & PHP_OCI_NUM) {
Z_ADDREF_P(element);
}
- add_u_assoc_zval(return_value, (UG(unicode) ? IS_UNICODE : IS_STRING), column->name, element);
+ add_u_assoc_zval(return_value, IS_UNICODE, column->name, element);
}
} else {
add_index_null(return_value, i);
}
if (fetch_mode & PHP_OCI_ASSOC) {
- add_u_assoc_null(return_value, (UG(unicode) ? IS_UNICODE : IS_STRING), column->name);
+ add_u_assoc_null(return_value, IS_UNICODE, column->name);
}
}
}
/* Set the Connection class and purity if OCI client version >= 11g */
#if (OCI_MAJOR_VERSION > 10)
- PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(connection_class), (ub4)UG(unicode) ? USTR_BYTES(type, u_strlen((UChar *)OCI_G(connection_class))) : strlen(OCI_G(connection_class)), (ub4)OCI_ATTR_CONNECTION_CLASS, OCI_G(err)));
+ PHP_OCI_CALL_RETURN(OCI_G(errcode),OCIAttrSet, ((dvoid *) connection->authinfo,(ub4) OCI_HTYPE_SESSION, (dvoid *) OCI_G(connection_class), (ub4)USTR_BYTES(type, u_strlen((UChar *)OCI_G(connection_class))), (ub4)OCI_ATTR_CONNECTION_CLASS, OCI_G(err)));
if (OCI_G(errcode) != OCI_SUCCESS) {
php_oci_error(OCI_G(err), OCI_G(errcode) TSRMLS_CC);
OCINumber oci_number;
php_oci_connection *connection = collection->connection;
- if (UG(unicode)) {
- element_double = zend_u_strtod(number.u, NULL);
- } else {
- element_double = zend_strtod(number.s, NULL);
- }
+ element_double = zend_u_strtod(number.u, NULL);
PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
return 1;
}
- if (UG(unicode)) {
- ZVAL_UNICODEL(*result_element, (UChar *)buff, TEXT_CHARS(buff_len), 1);
- /* Z_UNIVAL_P(*result_element)[buff_len] = 0; XXX */
- } else {
- ZVAL_STRINGL(*result_element, (char *)buff, buff_len, 1);
- Z_STRVAL_P(*result_element)[buff_len] = '\0';
- }
+ ZVAL_UNICODEL(*result_element, (UChar *)buff, TEXT_CHARS(buff_len), 1);
+ /* Z_UNIVAL_P(*result_element)[buff_len] = 0; XXX */
return 0;
break;
if (str) {
PHP_OCI_CALL_RETURN(str_len, OCIStringSize, (connection->env, oci_string));
- if (UG(unicode)) {
- ZVAL_UNICODEL(*result_element, (UChar *)str, TEXT_CHARS(str_len), 1);
- } else {
- ZVAL_STRINGL(*result_element, (char *)str, str_len, 1);
- }
+ ZVAL_UNICODEL(*result_element, (UChar *)str, TEXT_CHARS(str_len), 1);
}
return 0;
}
OCINumber oci_number;
php_oci_connection *connection = collection->connection;
- if (UG(unicode)) {
- element_double = zend_u_strtod(number.u, NULL);
- } else {
- element_double = zend_strtod(number.s, NULL);
- }
+ element_double = zend_u_strtod(number.u, NULL);
PHP_OCI_CALL_RETURN(connection->errcode, OCINumberFromReal, (connection->err, &element_double, sizeof(double), &oci_number));
if (flags & PHP_OCI_NUM) {
zend_hash_next_index_insert(Z_ARRVAL_P(row), &element, sizeof(zval*), NULL);
} else { /* default to ASSOC */
- zend_u_symtable_update(Z_ARRVAL_P(row), (UG(unicode) ? IS_UNICODE : IS_STRING), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL);
+ zend_u_symtable_update(Z_ARRVAL_P(row), IS_UNICODE, columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL);
}
}
MAKE_STD_ZVAL(tmp);
array_init(tmp);
- zend_u_symtable_update(Z_ARRVAL_P(array), (UG(unicode) ? IS_UNICODE : IS_STRING), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
+ zend_u_symtable_update(Z_ARRVAL_P(array), IS_UNICODE, columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
}
}
memcpy(*(ctx->lob_data) + *(ctx->lob_len), bufxp, (size_t) lenp);
*(ctx->lob_len) += lenp;
- if (UG(unicode)) {
- *(*(ctx->lob_data) + *(ctx->lob_len) + 1) = 0;
- }
+ *(*(ctx->lob_data) + *(ctx->lob_len) + 1) = 0;
*(*(ctx->lob_data) + *(ctx->lob_len)) = 0;
return OCI_CONTINUE;
if (column == NULL) {
continue;
} else if ((int) column->name_len == column_name_len) {
- if (!UG(unicode) && !strncmp(column->name.s, column_name.s, column_name_len)) {
- return column;
- } else if (UG(unicode) && !u_strncmp(column->name.u, column_name.u, column_name_len)) {
+ if (!u_strncmp(column->name.u, column_name.u, column_name_len)) {
return column;
}
}
}
PHP_OCI_CALL(OCIDescriptorFree, (param, OCI_DTYPE_PARAM));
- if (UG(unicode)) {
- outcol->name_len = TEXT_CHARS(outcol->name_len);
- outcol->name.u = eustrndup((UChar*) colname, outcol->name_len);
- } else {
- outcol->name.s = estrndup((char*) colname, outcol->name_len);
- }
+ outcol->name_len = TEXT_CHARS(outcol->name_len);
+ outcol->name.u = eustrndup((UChar*) colname, outcol->name_len);
/* find a user-setted define */
if (statement->defines) {
ub2 curr_element_length = TEXT_CHARS(bind->array.element_lengths[i]);
if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
zval_dtor(*entry);
- if (UG(unicode)) {
- tmp.u = ((UChar *)bind->array.elements)+TEXT_CHARS(i*bind->array.max_length);
- } else {
- tmp.s = (char *)(((text *)bind->array.elements)+(i*bind->array.max_length));
- }
+ tmp.u = ((UChar *)bind->array.elements)+TEXT_CHARS(i*bind->array.max_length);
ZVAL_TEXTL(*entry, tmp, curr_element_length, 1);
zend_hash_move_forward(hash);
case SQLT_AFC:
case SQLT_CHR: /* SQLT_CHR is the default value when type was not specified */
if (Z_TYPE_P(var) != IS_NULL) {
- convert_to_text(var);
+ convert_to_unicode(var);
}
if (maxlength == -1) {
switch (Z_TYPE_P(var)) {
*indpp = (dvoid *)&phpbind->indicator;
} else if ((phpbind->descriptor == 0) && (phpbind->statement == 0)) {
/* "normal string bind */
- convert_to_text(val);
+ convert_to_unicode(val);
- if (UG(unicode)) {
- *bufpp = Z_UNIVAL_P(val).v;
- *alenp = UBYTES(Z_UNILEN_P(val));
- } else {
- *bufpp = Z_STRVAL_P(val);
- *alenp = Z_STRLEN_P(val);
- }
+ *bufpp = Z_UNIVAL_P(val).v;
+ *alenp = UBYTES(Z_UNILEN_P(val));
*indpp = (dvoid *)&phpbind->indicator;
} else if (phpbind->statement != 0) {
/* RSET */
*indpp = &phpbind->indicator;
retval = OCI_CONTINUE;
} else {
- if (UG(unicode)) {
- convert_to_unicode(val);
- zval_dtor(val);
-
- Z_UNILEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
- Z_UNIVAL_P(val).v = ecalloc(1, UBYTES(Z_UNILEN_P(phpbind->zval) + 1));
-
- *alenpp = (ub4*) &Z_UNILEN_P(phpbind->zval);
- *bufpp = Z_UNIVAL_P(phpbind->zval).v;
- *piecep = OCI_ONE_PIECE;
- *rcodepp = &phpbind->retcode;
- *indpp = &phpbind->indicator;
- retval = OCI_CONTINUE;
- } else {
- convert_to_string(val);
- zval_dtor(val);
+ convert_to_unicode(val);
+ zval_dtor(val);
- Z_STRLEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
- Z_STRVAL_P(val) = ecalloc(1, Z_STRLEN_P(phpbind->zval) + 1);
+ Z_UNILEN_P(val) = PHP_OCI_PIECE_SIZE; /* 64K-1 is max XXX */
+ Z_UNIVAL_P(val).v = ecalloc(1, UBYTES(Z_UNILEN_P(phpbind->zval) + 1));
- /* XXX we assume that zend-zval len has 4 bytes */
- *alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
- *bufpp = Z_STRVAL_P(phpbind->zval);
- *piecep = OCI_ONE_PIECE;
- *rcodepp = &phpbind->retcode;
- *indpp = &phpbind->indicator;
- retval = OCI_CONTINUE;
- }
+ *alenpp = (ub4*) &Z_UNILEN_P(phpbind->zval);
+ *bufpp = Z_UNIVAL_P(phpbind->zval).v;
+ *piecep = OCI_ONE_PIECE;
+ *rcodepp = &phpbind->retcode;
+ *indpp = &phpbind->indicator;
+ retval = OCI_CONTINUE;
}
return retval;
}
if (maxlength == -1) {
zend_hash_internal_pointer_reset(hash);
while (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
- convert_to_text_ex(entry);
+ convert_to_unicode_ex(entry);
if (Z_UNILEN_PP(entry) > maxlength) {
maxlength = Z_UNILEN_PP(entry) + 1;
}
}
bind = emalloc(sizeof(php_oci_bind));
- if (UG(unicode)) {
- bind->array.elements = (UChar *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(UChar), 0);
- memset(bind->array.elements, 0, max_table_length * sizeof(UChar) * (maxlength + 1));
- } else {
- bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
- memset(bind->array.elements, 0, max_table_length * sizeof(text) * (maxlength + 1));
- }
+ bind->array.elements = (UChar *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(UChar), 0);
+ memset(bind->array.elements, 0, max_table_length * sizeof(UChar) * (maxlength + 1));
+
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = TEXT_BYTES(maxlength);
for (i = 0; i < bind->array.current_length; i++) {
if (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
- convert_to_text_ex(entry);
+ convert_to_unicode_ex(entry);
bind->array.element_lengths[i] = TEXT_BYTES(Z_UNILEN_PP(entry));
if (Z_UNILEN_PP(entry) == 0) {
bind->array.indicators[i] = -1;
if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
int element_length;
- convert_to_text_ex(entry);
+ convert_to_unicode_ex(entry);
element_length = (maxlength > Z_UNILEN_PP(entry)) ? Z_UNILEN_PP(entry) : maxlength;
- if (UG(unicode)) {
- memcpy((UChar *)bind->array.elements + i*maxlength, Z_UNIVAL_PP(entry).u, TEXT_BYTES(element_length));
- ((UChar *)bind->array.elements)[i*maxlength + element_length] = '\0';
- } else {
- memcpy((text *)bind->array.elements + i*maxlength, Z_UNIVAL_PP(entry).s, element_length);
- ((text *)bind->array.elements)[i*maxlength + element_length] = '\0';
- }
+ memcpy((UChar *)bind->array.elements + i*maxlength, Z_UNIVAL_PP(entry).u, TEXT_BYTES(element_length));
+ ((UChar *)bind->array.elements)[i*maxlength + element_length] = '\0';
+
zend_hash_move_forward(hash);
} else {
break;
}
if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- convert_to_text_ex(entry);
- if (UG(unicode)) {
- PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)Z_UNIVAL_PP(entry).s, UBYTES(Z_UNILEN_PP(entry)), NULL, 0, NULL, 0, &oci_date));
- } else {
- PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_PP(entry), Z_STRLEN_PP(entry), NULL, 0, NULL, 0, &oci_date));
- }
+ convert_to_unicode_ex(entry);
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)Z_UNIVAL_PP(entry).s, UBYTES(Z_UNILEN_PP(entry)), NULL, 0, NULL, 0, &oci_date));
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
zend_hash_move_forward(hash);
} else {
- if (UG(unicode)) {
- UChar *tmp = USTR_MAKE("01-JAN-00");
- PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)tmp, UBYTES(sizeof("01-JAN-00")-1), NULL, 0, NULL, 0, &oci_date));
- efree(tmp);
- } else {
- PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)"01-JAN-00", sizeof("01-JAN-00")-1, NULL, 0, NULL, 0, &oci_date));
- }
+ UChar *tmp = USTR_MAKE("01-JAN-00");
+ PHP_OCI_CALL_RETURN(connection->errcode, OCIDateFromText, (connection->err, (CONST text *)tmp, UBYTES(sizeof("01-JAN-00")-1), NULL, 0, NULL, 0, &oci_date));
+ efree(tmp);
if (connection->errcode != OCI_SUCCESS) {
/* failed to convert string to date */
zend_hash_clean(&PCRE_G(pcre_cache));
} else {
#if HAVE_SETLOCALE
- if (!strcmp(pce->locale, locale) && UG(unicode) == pce->unicode_mode) {
+ if (!strcmp(pce->locale, locale)) {
return pce;
}
#else
- if (UG(unicode) == pce->unicode_mode) {
- return pce;
- }
+ return pce;
#endif
}
}
new_entry.extra = extra;
new_entry.preg_options = poptions;
new_entry.compile_options = coptions;
- new_entry.unicode_mode = UG(unicode);
#if HAVE_SETLOCALE
new_entry.locale = pestrdup(locale, 1);
new_entry.tables = tables;
*/
PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC)
{
- pcre_cache_entry * pce = pcre_get_compiled_regex_cache(ZEND_STR_TYPE, regex, strlen(regex) TSRMLS_CC);
+ pcre_cache_entry * pce = pcre_get_compiled_regex_cache(IS_UNICODE, regex, strlen(regex) TSRMLS_CC);
if (extra) {
*extra = pce ? pce->extra : NULL;
*/
PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC)
{
- pcre_cache_entry * pce = pcre_get_compiled_regex_cache(ZEND_STR_TYPE, regex, strlen(regex) TSRMLS_CC);
+ pcre_cache_entry * pce = pcre_get_compiled_regex_cache(IS_UNICODE, regex, strlen(regex) TSRMLS_CC);
if (extra) {
*extra = pce ? pce->extra : NULL;
if (name) {
zval_add_ref(&match_pair);
- if (UG(unicode)) {
- UErrorCode status = U_ZERO_ERROR;
- UChar *u = NULL;
- int u_len;
- zend_string_to_unicode_ex(UG(utf8_conv), &u, &u_len, name, strlen(name), &status);
- zend_u_hash_update(Z_ARRVAL_P(result), IS_UNICODE, ZSTR(u), u_len+1, &match_pair, sizeof(zval *), NULL);
- efree(u);
- } else {
- zend_hash_update(Z_ARRVAL_P(result), name, strlen(name)+1, &match_pair, sizeof(zval *), NULL);
- }
+ UErrorCode status = U_ZERO_ERROR;
+ UChar *u = NULL;
+ int u_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u, &u_len, name, strlen(name), &status);
+ zend_u_hash_update(Z_ARRVAL_P(result), IS_UNICODE, ZSTR(u), u_len+1, &match_pair, sizeof(zval *), NULL);
+ efree(u);
}
zend_hash_next_index_insert(Z_ARRVAL_P(result), &match_pair, sizeof(zval *), NULL);
}
* arrays with empty strings.
*/
if (count < num_subpats) {
- if (UG(unicode)) {
- for (; i < num_subpats; i++) {
- add_next_index_unicode(match_sets[i], EMPTY_STR, 1);
- }
- } else {
- for (; i < num_subpats; i++) {
- add_next_index_string(match_sets[i], "", 1);
- }
+ for (; i < num_subpats; i++) {
+ add_next_index_unicode(match_sets[i], EMPTY_STR, 1);
}
}
} else {
int u_len;
for (i = 0; i < num_subpats; i++) {
if (subpat_names[i]) {
- if (UG(unicode)) {
- zend_string_to_unicode_ex(UG(utf8_conv), &u, &u_len, subpat_names[i], strlen(subpat_names[i]), &status);
- zend_u_hash_update(Z_ARRVAL_P(subpats), IS_UNICODE, ZSTR(u),
- u_len+1, &match_sets[i], sizeof(zval *), NULL);
- Z_ADDREF_P(match_sets[i]);
- efree(u);
- status = U_ZERO_ERROR;
- } else {
- zend_hash_update(Z_ARRVAL_P(subpats), subpat_names[i],
- strlen(subpat_names[i])+1, &match_sets[i], sizeof(zval *), NULL);
- Z_ADDREF_P(match_sets[i]);
- }
+ zend_string_to_unicode_ex(UG(utf8_conv), &u, &u_len, subpat_names[i], strlen(subpat_names[i]), &status);
+ zend_u_hash_update(Z_ARRVAL_P(subpats), IS_UNICODE, ZSTR(u),
+ u_len+1, &match_sets[i], sizeof(zval *), NULL);
+ Z_ADDREF_P(match_sets[i]);
+ efree(u);
+ status = U_ZERO_ERROR;
}
zend_hash_next_index_insert(Z_ARRVAL_P(subpats), &match_sets[i], sizeof(zval *), NULL);
}
switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(subject), &string_key, &string_key_len, &num_key, 0, NULL))
{
case HASH_KEY_IS_UNICODE:
- if (utype == IS_UNICODE || (UG(unicode) && utype != IS_STRING)) {
+ if (utype == IS_UNICODE || utype != IS_STRING) {
add_u_assoc_utf8_stringl_ex(return_value, IS_UNICODE, string_key, string_key_len, result, result_len, ZSTR_AUTOFREE);
} else {
add_u_assoc_stringl_ex(return_value, IS_UNICODE, string_key, string_key_len, result, result_len, 0);
break;
case HASH_KEY_IS_STRING:
- if (utype == IS_UNICODE || (UG(unicode) && utype != IS_STRING)) {
+ if (utype == IS_UNICODE || utype != IS_STRING) {
add_u_assoc_utf8_stringl_ex(return_value, IS_STRING, string_key, string_key_len, result, result_len, ZSTR_AUTOFREE);
} else {
add_u_assoc_stringl_ex(return_value, IS_STRING, string_key, string_key_len, result, result_len, 0);
break;
case HASH_KEY_IS_LONG:
- if (utype == IS_UNICODE || (UG(unicode) && utype != IS_STRING)) {
+ if (utype == IS_UNICODE || utype != IS_STRING) {
add_index_utf8_stringl(return_value, num_key, result, result_len, ZSTR_AUTOFREE);
} else {
add_index_stringl(return_value, num_key, result, result_len, 0);
old_replace_count = replace_count;
if ((result = php_replace_in_subject(regex, replace, &subject, &result_len, limit, is_callable_replace, &replace_count TSRMLS_CC)) != NULL) {
if (!is_filter || replace_count > old_replace_count) {
- if (utype == IS_UNICODE || (UG(unicode) && utype != IS_STRING)) {
+ if (utype == IS_UNICODE || utype != IS_STRING) {
RETVAL_UTF8_STRINGL(result, result_len, ZSTR_AUTOFREE);
} else {
RETVAL_STRINGL(result, result_len, 0);
}
if (delim && *delim) {
- if (UG(unicode)) {
- U8_GET((unsigned char*)delim, 0, 0, delim_len, delim_char);
- } else {
- delim_char = (UChar32)delim[0];
- }
+ U8_GET((unsigned char*)delim, 0, 0, delim_len, delim_char);
quote_delim = 1;
}
sequence is 4 bytes, so the multiplier is (4+1). In non-Unicode mode, we
have to assume that any character can be '\0', which needs 4 chars to
be escaped. */
- out_str = safe_emalloc(UG(unicode)?5:4, in_str_len, 1);
+ out_str = safe_emalloc(5, in_str_len, 1);
/* Go through the string and quote necessary characters */
for(p = in_str, q = out_str; p != in_str_end; p++) {
#endif
int compile_options;
int refcount;
- zend_bool unicode_mode;
} pcre_cache_entry;
PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_uchar utype, char *regex, int regex_len TSRMLS_DC);
ZVAL_ASCII_STRINGL(&z_key, "queryString", sizeof("queryString")-1, 0);
std_object_handlers.write_property(object, &z_key, query_string TSRMLS_CC);
zval_ptr_dtor(&query_string);
-#ifdef IS_UNICODE
- if (UG(unicode)) {
- zval_dtor(&z_key);
- }
-#endif
+ zval_dtor(&z_key);
if (dbstmt_ce->constructor) {
zend_fcall_info fci;
zval *object = *object_pp;
#endif
pdo_dbh_t *dbh = zend_object_store_get_object(object TSRMLS_CC);
-#ifdef IS_UNICODE
- zend_uchar ztype = UG(unicode) ? IS_UNICODE : IS_STRING;
-#endif
+ zend_uchar ztype = IS_UNICODE;
lc_method_name = zend_u_str_tolower_dup(ztype, method_name, method_len);
#if PHP_API_VERSION >= 20041225
zval *object = *object_pp;
#endif
-#ifdef IS_UNICODE
- zend_uchar ztype = UG(unicode) ? IS_UNICODE : IS_STRING;
-#endif
+ zend_uchar ztype = IS_UNICODE;
lc_method_name = zend_u_str_tolower_dup(ztype, method_name, method_len);
{
zend_function *fbc;
zstr lc_method_name;
-#ifdef IS_UNICODE
- zend_uchar ztype = UG(unicode) ? IS_UNICODE : IS_STRING;
-#endif
+ zend_uchar ztype = IS_UNICODE;
lc_method_name = zend_u_str_tolower_dup(ztype, method_name, method_len);
if (parent) {
return FAILURE;
} else {
- *class_name = ezstrndup(ZEND_STR_TYPE, ZSTR("PDORow"), sizeof("PDORow") - 1);
+ *class_name = ezstrndup(IS_UNICODE, ZSTR("PDORow"), sizeof("PDORow") - 1);
*class_name_len = sizeof("PDORow")-1;
return SUCCESS;
}
zend_function *copy_fptr;
copy_fptr = emalloc(sizeof(zend_function));
memcpy(copy_fptr, fptr, sizeof(zend_function));
- if (UG(unicode)) {
- copy_fptr->internal_function.function_name.u = eustrdup(fptr->internal_function.function_name.u);
- } else {
- copy_fptr->internal_function.function_name.s = estrdup(fptr->internal_function.function_name.s);
- }
+ copy_fptr->internal_function.function_name.u = eustrdup(fptr->internal_function.function_name.u);
return copy_fptr;
} else {
/* no copy needed */
zend_uchar prop_type;
ulong index;
- if ((prop_type = zend_hash_get_current_key_ex(properties, &prop_name, &prop_name_size, &index, 0, &pos)) == (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING)) {
- if (prop_name_size && (UG(unicode)?prop_name.u[0]:prop_name.s[0])) { /* skip all private and protected properties */
+ if ((prop_type = zend_hash_get_current_key_ex(properties, &prop_name, &prop_name_size, &index, 0, &pos)) == HASH_KEY_IS_UNICODE) {
+ if (prop_name_size && prop_name.u[0]) { /* skip all private and protected properties */
if (!zend_u_hash_exists(&ce->properties_info, prop_type, prop_name, prop_name_size)) {
count++;
_property_string(&dyn, NULL, prop_name, sub_indent.string TSRMLS_CC);
zstr key;
uint key_len;
ulong num_index;
- uint lcname_len, len = UG(unicode)?u_strlen(mptr->common.function_name.u):strlen(mptr->common.function_name.s);
- zstr lcname = zend_u_str_case_fold(ZEND_STR_TYPE, mptr->common.function_name, len, 1, &lcname_len);
+ uint lcname_len, len = u_strlen(mptr->common.function_name.u);
+ zstr lcname = zend_u_str_case_fold(IS_UNICODE, mptr->common.function_name, len, 1, &lcname_len);
/* Do not display old-style inherited constructors */
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0
|| mptr->common.scope == ce
- || zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING)
- || (UG(unicode)
- ? zend_u_binary_strcmp(key.u, key_len-1, lcname.u, lcname_len) == 0
- : zend_binary_strcmp(key.s, key_len-1, lcname.s, lcname_len) == 0))
+ || zend_hash_get_current_key_ex(&ce->function_table, &key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_UNICODE
+ || zend_u_binary_strcmp(key.u, key_len-1, lcname.u, lcname_len) == 0)
{
zend_function *closure;
/* see if this is a closure */
if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
- && ZEND_U_EQUAL(ZEND_STR_TYPE, lcname, len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+ && ZEND_U_EQUAL(IS_UNICODE, lcname, len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& (closure = zend_get_closure_invoke_method(obj TSRMLS_CC)) != NULL)
{
mptr = closure;
} else if (Z_TYPE_P(zv) == IS_NULL) {
string_write(str, "NULL", sizeof("NULL")-1);
} else if (Z_TYPE_P(zv) == IS_STRING) {
- if (UG(unicode)) {
- string_write(str, "b'", sizeof("b")-1);
- }
+ string_write(str, "b'", sizeof("b")-1);
string_write(str, "'", sizeof("'")-1);
string_write(str, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 15));
if (Z_STRLEN_P(zv) > 15) {
if (fptr->common.scope != scope) {
string_printf(str, ", inherits %v", fptr->common.scope->name);
} else if (fptr->common.scope->parent) {
- lc_name = zend_u_str_case_fold(ZEND_STR_TYPE, fptr->common.function_name, USTR_LEN(fptr->common.function_name), 1, &lc_name_len);
- if (zend_u_hash_find(&fptr->common.scope->parent->function_table, ZEND_STR_TYPE, lc_name, lc_name_len + 1, (void**) &overwrites) == SUCCESS) {
+ lc_name = zend_u_str_case_fold(IS_UNICODE, fptr->common.function_name, USTR_LEN(fptr->common.function_name), 1, &lc_name_len);
+ if (zend_u_hash_find(&fptr->common.scope->parent->function_table, IS_UNICODE, lc_name, lc_name_len + 1, (void**) &overwrites) == SUCCESS) {
if (fptr->common.scope != overwrites->common.scope) {
string_printf(str, ", overwrites %v", overwrites->common.scope->name);
}
string_printf(str, "static ");
}
- zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, prop->name, prop->name_length, &class_name, &prop_name);
+ zend_u_unmangle_property_name(IS_UNICODE, prop->name, prop->name_length, &class_name, &prop_name);
string_printf(str, "$%v", prop_name);
}
zval *classname;
property_reference *reference;
zstr class_name, prop_name;
- zend_uchar utype = UG(unicode) ? IS_UNICODE : IS_STRING;
+ zend_uchar utype = IS_UNICODE;
zend_u_unmangle_property_name(utype, prop->name, prop->name_length, &class_name, &prop_name);
/* we have to search the class hierarchy for this (implicit) public or protected property */
zend_class_entry *tmp_ce = ce, *store_ce = ce;
zend_property_info *tmp_info = NULL;
- int prop_name_len = UG(unicode) ? u_strlen(prop_name.u) : strlen(prop_name.s);
+ int prop_name_len = u_strlen(prop_name.u);
while (tmp_ce && zend_u_hash_find(&tmp_ce->properties_info, utype, prop_name, prop_name_len + 1, (void **) &tmp_info) != SUCCESS) {
ce = tmp_ce;
}
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment.v) {
- RETURN_ZSTRL(ZEND_STR_TYPE, fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1);
+ RETURN_ZSTRL(IS_UNICODE, fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1);
}
RETURN_FALSE;
}
if (Z_TYPE_PP(classref) == IS_OBJECT) {
ce = Z_OBJCE_PP(classref);
} else {
- convert_to_text_ex(classref);
+ convert_to_unicode_ex(classref);
if (zend_u_lookup_class(Z_TYPE_PP(classref), Z_UNIVAL_PP(classref), Z_UNILEN_PP(classref), &pce TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Class %R does not exist", Z_TYPE_PP(classref), Z_UNIVAL_PP(classref));
ce = *pce;
}
- convert_to_text_ex(method);
+ convert_to_unicode_ex(method);
lcname = zend_u_str_case_fold(Z_TYPE_PP(method), Z_UNIVAL_PP(method), Z_UNILEN_PP(method), 1, &lcname_len);
if (ce == zend_ce_closure && Z_TYPE_PP(classref) == IS_OBJECT
&& lcname_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1
- && ZEND_U_EQUAL(ZEND_STR_TYPE, lcname, lcname_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+ && ZEND_U_EQUAL(IS_UNICODE, lcname, lcname_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& (fptr = zend_get_closure_invoke_method(*classref TSRMLS_CC)) != NULL)
{
/* do nothing, fptr is already set */
zend_uint i;
position= -1;
- convert_to_text_ex(parameter);
+ convert_to_unicode_ex(parameter);
for (i = 0; i < fptr->common.num_args; i++) {
if (Z_TYPE_PP(parameter) == IS_STRING && arg_info[i].name.s && strcmp(arg_info[i].name.s, Z_STRVAL_PP(parameter)) == 0) {
position= i;
* TODO: Think about moving these checks to the compiler or some sort of
* lint-mode.
*/
- if (ZEND_U_EQUAL(ZEND_STR_TYPE, param->arg_info->class_name, param->arg_info->class_name_len, "self", sizeof("self")- 1)) {
+ if (ZEND_U_EQUAL(IS_UNICODE, param->arg_info->class_name, param->arg_info->class_name_len, "self", sizeof("self")- 1)) {
ce = param->fptr->common.scope;
if (!ce) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
return;
}
pce= &ce;
- } else if (ZEND_U_EQUAL(ZEND_STR_TYPE, param->arg_info->class_name, param->arg_info->class_name_len, "parent", sizeof("parent")- 1)) {
+ } else if (ZEND_U_EQUAL(IS_UNICODE, param->arg_info->class_name, param->arg_info->class_name_len, "parent", sizeof("parent")- 1)) {
ce = param->fptr->common.scope;
if (!ce) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
return;
}
pce= &ce->parent;
- } else if (zend_u_lookup_class(UG(unicode)?IS_UNICODE:IS_STRING, param->arg_info->class_name, param->arg_info->class_name_len, &pce TSRMLS_CC) == FAILURE) {
+ } else if (zend_u_lookup_class(IS_UNICODE, param->arg_info->class_name, param->arg_info->class_name_len, &pce TSRMLS_CC) == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Class %v does not exist", param->arg_info->class_name);
return;
zend_uchar type;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o", &classname) == SUCCESS) {
- if (UG(unicode)) {
- name_str.u = USTR_MAKE(ZEND_INVOKE_FUNC_NAME);
- free_name_str = 1;
- type = IS_UNICODE;
- } else {
- name_str.s = ZEND_INVOKE_FUNC_NAME;
- type = IS_STRING;
- }
+ name_str.u = USTR_MAKE(ZEND_INVOKE_FUNC_NAME);
+ free_name_str = 1;
+ type = IS_UNICODE;
name_len = sizeof(ZEND_INVOKE_FUNC_NAME)-1;
orig_obj = classname;
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "zt", &classname, &name_str, &name_len, &type) == FAILURE) {
lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len);
if (ce == zend_ce_closure && orig_obj && (lcname_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
- && ZEND_U_EQUAL(ZEND_STR_TYPE, lcname, lcname_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+ && ZEND_U_EQUAL(IS_UNICODE, lcname, lcname_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& (mptr = zend_get_closure_invoke_method(orig_obj TSRMLS_CC)) != NULL)
{
/* do nothing, mptr already set */
zstr prop_name, class_name;
int prop_name_len;
- zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, key, key_len-1, &class_name, &prop_name);
- prop_name_len = UG(unicode) ? u_strlen(prop_name.u) : strlen(prop_name.s);
+ zend_u_unmangle_property_name(IS_UNICODE, key, key_len-1, &class_name, &prop_name);
+ prop_name_len = u_strlen(prop_name.u);
zval_add_ref(value);
- zend_u_hash_update(Z_ARRVAL_P(return_value), UG(unicode)?IS_UNICODE:IS_STRING, prop_name, prop_name_len+1, value, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(return_value), IS_UNICODE, prop_name, prop_name_len+1, value, sizeof(zval *), NULL);
}
zend_hash_move_forward_ex(CE_STATIC_MEMBERS(ce), &pos);
}
zend_hash_get_current_key_ex(ht_list[i], &key, &key_len, &num_index, 0, &pos);
zend_hash_move_forward_ex(ht_list[i], &pos);
- zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, key, key_len-1, &class_name, &prop_name);
+ zend_u_unmangle_property_name(IS_UNICODE, key, key_len-1, &class_name, &prop_name);
if (class_name.s && class_name.s[0] != '*'
- && (UG(unicode)?u_strcmp(class_name.u, ce->name.u):strcmp(class_name.s, ce->name.s)))
+ && u_strcmp(class_name.u, ce->name.u))
{
/* filter privates from base classes */
continue;
zval_copy_ctor(prop_copy);
INIT_PZVAL(prop_copy);
- add_u_assoc_zval(return_value, ZEND_STR_TYPE, prop_name, prop_copy);
+ add_u_assoc_zval(return_value, IS_UNICODE, prop_name, prop_copy);
}
}
}
}
GET_REFLECTION_OBJECT_PTR(ce);
if (ce->type == ZEND_USER_CLASS && ce->doc_comment.v) {
- RETURN_ZSTRL(ZEND_STR_TYPE, ce->doc_comment, ce->doc_comment_len, 1);
+ RETURN_ZSTRL(IS_UNICODE, ce->doc_comment, ce->doc_comment_len, 1);
}
RETURN_FALSE;
}
GET_REFLECTION_OBJECT_PTR(ce);
lc_name = zend_u_str_case_fold(type, name, name_len, 1, &lc_name_len);
if (ce == zend_ce_closure && intern->obj && (lc_name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
- && ZEND_U_EQUAL(ZEND_STR_TYPE, lc_name, lc_name_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+ && ZEND_U_EQUAL(IS_UNICODE, lc_name, lc_name_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& (mptr = zend_get_closure_invoke_method(intern->obj TSRMLS_CC)) != NULL)
{
reflection_method_factory(ce, mptr, return_value TSRMLS_CC);
static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, long filter, zval *obj TSRMLS_DC)
{
zval *method;
- uint len = UG(unicode)?u_strlen(mptr->common.function_name.u):strlen(mptr->common.function_name.s);
+ uint len = u_strlen(mptr->common.function_name.u);
zend_function *closure;
if (mptr->common.fn_flags & filter) {
unsigned int lc_name_len;
- zstr lc_name = zend_u_str_case_fold(ZEND_STR_TYPE, mptr->common.function_name, len, 1, &lc_name_len);
+ zstr lc_name = zend_u_str_case_fold(IS_UNICODE, mptr->common.function_name, len, 1, &lc_name_len);
ALLOC_ZVAL(method);
if (ce == zend_ce_closure && obj && (lc_name_len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
- && ZEND_U_EQUAL(ZEND_STR_TYPE, lc_name, lc_name_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
+ && ZEND_U_EQUAL(IS_UNICODE, lc_name, lc_name_len, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& (closure = zend_get_closure_invoke_method(obj TSRMLS_CC)) != NULL)
{
mptr = closure;
zval *interface;
ALLOC_ZVAL(interface);
zend_reflection_class_factory(ce->interfaces[i], interface TSRMLS_CC);
- add_u_assoc_zval_ex(return_value, UG(unicode)?IS_UNICODE:IS_STRING, ce->interfaces[i]->name, ce->interfaces[i]->name_length + 1, interface);
+ add_u_assoc_zval_ex(return_value, IS_UNICODE, ce->interfaces[i]->name, ce->interfaces[i]->name_length + 1, interface);
}
}
}
MAKE_STD_ZVAL(propname);
if (dynam_prop == 0) {
- zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, property_info->name_length, &class_name, &prop_name);
+ zend_u_unmangle_property_name(IS_UNICODE, property_info->name, property_info->name_length, &class_name, &prop_name);
ZVAL_TEXT(propname, prop_name, 1);
} else {
ZVAL_TEXTL(propname, name_str, name_len, 1);
property_reference *ref;
HashTable *prop_defaults;
zval **zdef, *zv;
- zend_uchar utype = UG(unicode) ? IS_UNICODE : IS_STRING;
+ zend_uchar utype = IS_UNICODE;
if (zend_parse_parameters_none() == FAILURE) {
return;
property_reference *ref;
zval *object, name;
zval **member= NULL, *member_p;
- zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar utype = IS_UNICODE;
METHOD_NOTSTATIC(reflection_property_ptr);
GET_REFLECTION_OBJECT_PTR(ref);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o", &object) == FAILURE) {
return;
}
- zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, ref->prop.name, ref->prop.name_length, &class_name, &prop_name);
- prop_name_len = UG(unicode) ? u_strlen(prop_name.u) : strlen(prop_name.s);
- member_p = zend_u_read_property(Z_OBJCE_P(object), object, UG(unicode)?IS_UNICODE:IS_STRING, prop_name, prop_name_len, 1 TSRMLS_CC);
+ zend_u_unmangle_property_name(IS_UNICODE, ref->prop.name, ref->prop.name_length, &class_name, &prop_name);
+ prop_name_len = u_strlen(prop_name.u);
+ member_p = zend_u_read_property(Z_OBJCE_P(object), object, IS_UNICODE, prop_name, prop_name_len, 1 TSRMLS_CC);
*return_value= *member_p;
zval_copy_ctor(return_value);
INIT_PZVAL(return_value);
int setter_done = 0;
zval *tmp;
HashTable *prop_table;
- zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
+ zend_uchar utype = IS_UNICODE;
METHOD_NOTSTATIC(reflection_property_ptr);
GET_REFLECTION_OBJECT_PTR(ref);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "oz", &object, &value) == FAILURE) {
return;
}
- zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, ref->prop.name, ref->prop.name_length, &class_name, &prop_name);
- prop_name_len = UG(unicode) ? u_strlen(prop_name.u) : strlen(prop_name.s);
- zend_u_update_property(Z_OBJCE_P(object), object, UG(unicode)?IS_UNICODE:IS_STRING, prop_name, prop_name_len, value TSRMLS_CC);
+ zend_u_unmangle_property_name(IS_UNICODE, ref->prop.name, ref->prop.name_length, &class_name, &prop_name);
+ prop_name_len = u_strlen(prop_name.u);
+ zend_u_update_property(Z_OBJCE_P(object), object, IS_UNICODE, prop_name, prop_name_len, value TSRMLS_CC);
}
}
/* }}} */
}
GET_REFLECTION_OBJECT_PTR(ref);
- if (zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, ref->prop.name, ref->prop.name_length, &class_name, &prop_name) != SUCCESS) {
+ if (zend_u_unmangle_property_name(IS_UNICODE, ref->prop.name, ref->prop.name_length, &class_name, &prop_name) != SUCCESS) {
RETURN_FALSE;
}
prop_name_len = USTR_LEN(prop_name);
ce = tmp_ce = ref->ce;
- while (tmp_ce && zend_u_hash_find(&tmp_ce->properties_info, UG(unicode)?IS_UNICODE:IS_STRING, prop_name, prop_name_len + 1, (void **) &tmp_info) == SUCCESS) {
+ while (tmp_ce && zend_u_hash_find(&tmp_ce->properties_info, IS_UNICODE, prop_name, prop_name_len + 1, (void **) &tmp_info) == SUCCESS) {
if (tmp_info->flags & ZEND_ACC_PRIVATE || tmp_info->flags & ZEND_ACC_SHADOW) {
/* it's a private property, so it can't be inherited */
break;
}
GET_REFLECTION_OBJECT_PTR(ref);
if (ref->prop.doc_comment.v) {
- RETURN_ZSTRL(ZEND_STR_TYPE, ref->prop.doc_comment, ref->prop.doc_comment_len, 1);
+ RETURN_ZSTRL(IS_UNICODE, ref->prop.doc_comment, ref->prop.doc_comment_len, 1);
}
RETURN_FALSE;
}
*const_val = constant->value;
zval_copy_ctor(const_val);
INIT_PZVAL(const_val);
- add_u_assoc_zval_ex(retval, ZEND_STR_TYPE, constant->name, constant->name_len, const_val);
+ add_u_assoc_zval_ex(retval, IS_UNICODE, constant->name, constant->name_len, const_val);
}
return 0;
}
if (add_reflection_class) {
ALLOC_ZVAL(zclass);
zend_reflection_class_factory(*pce, zclass TSRMLS_CC);
- add_u_assoc_zval_ex(class_array, ZEND_STR_TYPE, (*pce)->name, (*pce)->name_length + 1, zclass);
+ add_u_assoc_zval_ex(class_array, IS_UNICODE, (*pce)->name, (*pce)->name_length + 1, zclass);
} else {
add_next_index_textl(class_array, (*pce)->name, (*pce)->name_length, 1);
}
n += key_len;
buf[n] = '\0';
- if (UG(unicode) && UG(filesystem_encoding_conv) &&
+ if (UG(filesystem_encoding_conv) &&
ucnv_getType(UG(filesystem_encoding_conv)) != UCNV_UTF8) {
char *newbuf = NULL;
int newlen;
************************ */
#define USTR_EQUAL(s1, len1, s2, len2) \
- ((len1) == (len2) && \
- (UG(unicode) ? \
- (zend_u_binary_strcmp((s1).u, (len1), (s2).u, (len2)) == 0) \
- : (zend_binary_strcmp((s1).s, (len1), (s2).s, (len2)) == 0)))
+ ((len1) == (len2) && zend_u_binary_strcmp((s1).u, (len1), (s2).u, (len2)) == 0)
static inline void php_session_rfc1867_early_find_sid(php_session_rfc1867_progress *progress TSRMLS_DC) /* {{{ */
{
value = sxe_get_value(value TSRMLS_CC);
INIT_PZVAL(value);
new_value = 1;
- if (UG(unicode)) {
- convert_to_string_with_converter(value, UG(utf8_conv));
- }
+ convert_to_string_with_converter(value, UG(utf8_conv));
break;
}
/* break is missing intentionally */
array_init(zattr);
sxe_properties_add(rv, "@attributes", sizeof("@attributes"), zattr TSRMLS_CC);
}
- if (UG(unicode)) {
- UErrorCode status = U_ZERO_ERROR;
- zstr u_name;
- int u_name_len;
- zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)attr->name, namelen, &status);
- add_u_assoc_zval_ex(zattr, IS_UNICODE, u_name, u_name_len, value);
- efree(u_name.u);
- } else {
- add_assoc_zval_ex(zattr, (char*)attr->name, namelen, value);
- }
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)attr->name, namelen, &status);
+ add_u_assoc_zval_ex(zattr, IS_UNICODE, u_name, u_name_len, value);
+ efree(u_name.u);
}
attr = attr->next;
}
prefix_len = strlen(prefix) + 1;
if (zend_ascii_hash_exists(Z_ARRVAL_P(return_value), prefix, prefix_len) == 0) {
- if (UG(unicode)) {
- UErrorCode status = U_ZERO_ERROR;
- UChar *u_str;
- zstr u_prefix;
- int u_len, u_prefix_len;
- int length = strlen((char*)ns->href);
- zend_string_to_unicode_ex(UG(utf8_conv), &u_str, &u_len, (char*)ns->href, length, &status);
- zend_string_to_unicode_ex(UG(utf8_conv), &u_prefix.u, &u_prefix_len, prefix, prefix_len, &status);
- add_u_assoc_unicodel_ex(return_value, IS_UNICODE, u_prefix, u_prefix_len, u_str, u_len, 0);
- efree(u_prefix.u);
- } else {
- add_assoc_string_ex(return_value, prefix, prefix_len, (char*)ns->href, 1);
- }
+ UErrorCode status = U_ZERO_ERROR;
+ UChar *u_str;
+ zstr u_prefix;
+ int u_len, u_prefix_len;
+ int length = strlen((char*)ns->href);
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_str, &u_len, (char*)ns->href, length, &status);
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_prefix.u, &u_prefix_len, prefix, prefix_len, &status);
+ add_u_assoc_unicodel_ex(return_value, IS_UNICODE, u_prefix, u_prefix_len, u_str, u_len, 0);
+ efree(u_prefix.u);
}
}
/* }}} */
MAKE_STD_ZVAL(retval);
- if (sxe_object_cast(z, retval, UG(unicode)?IS_UNICODE:IS_STRING, NULL TSRMLS_CC)==FAILURE) {
+ if (sxe_object_cast(z, retval, IS_UNICODE, NULL TSRMLS_CC)==FAILURE) {
zend_error(E_ERROR, "Unable to cast node to string");
/* FIXME: Should not be fatal */
}
return HASH_KEY_NON_EXISTANT;
}
- if (UG(unicode)) {
- UErrorCode status = U_ZERO_ERROR;
- int u_len;
+ UErrorCode status = U_ZERO_ERROR;
+ int u_len;
- namelen = xmlStrlen(curnode->name);
- zend_string_to_unicode_ex(UG(utf8_conv), &str_key->u, &u_len, (char*)curnode->name, namelen, &status);
- *str_key_len = u_len + 1;
- return HASH_KEY_IS_UNICODE;
- } else {
- namelen = xmlStrlen(curnode->name);
- str_key->s = estrndup((char *)curnode->name, namelen);
- *str_key_len = namelen + 1;
- return HASH_KEY_IS_STRING;
- }
+ namelen = xmlStrlen(curnode->name);
+ zend_string_to_unicode_ex(UG(utf8_conv), &str_key->u, &u_len, (char*)curnode->name, namelen, &status);
+ *str_key_len = u_len + 1;
+ return HASH_KEY_IS_UNICODE;
}
/* }}} */
for (zend_hash_internal_pointer_reset_ex(SOAP_GLOBAL(class_map), &pos);
zend_hash_get_current_data_ex(SOAP_GLOBAL(class_map), (void **) &tmp, &pos) == SUCCESS;
zend_hash_move_forward_ex(SOAP_GLOBAL(class_map), &pos)) {
- if ((!UG(unicode) &&
- Z_TYPE_PP(tmp) == IS_STRING &&
- ce->name_length == Z_STRLEN_PP(tmp) &&
- zend_binary_strncasecmp(ce->name.s, ce->name_length, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), ce->name_length) == 0) ||
- (UG(unicode) &&
- Z_TYPE_PP(tmp) == IS_UNICODE &&
+ if ((Z_TYPE_PP(tmp) == IS_UNICODE &&
ce->name_length == Z_USTRLEN_PP(tmp) &&
zend_u_binary_strncasecmp(ce->name.u, ce->name_length, Z_USTRVAL_PP(tmp), Z_USTRLEN_PP(tmp), ce->name_length) == 0)) {
array_init(zcookie);
MAKE_STD_ZVAL(zvalue);
ZVAL_STRINGL(zvalue, eqpos + 1, cookie_len, 1);
- if (UG(unicode)) {
- zval_string_to_unicode_ex(zvalue, UG(utf8_conv) TSRMLS_CC);
- }
+ zval_string_to_unicode_ex(zvalue, UG(utf8_conv) TSRMLS_CC);
add_index_zval(zcookie, 0, zvalue);
if (sempos != NULL) {
tmp = master_to_zval(NULL, val);
}
}
- if (UG(unicode)) {
- UErrorCode status = U_ZERO_ERROR;
- zstr u_name;
- int u_name_len;
- zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, param->paramName, strlen(param->paramName), &status);
- add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp);
- efree(u_name.u);
- } else {
- add_assoc_zval(return_value, param->paramName, tmp);
- }
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, param->paramName, strlen(param->paramName), &status);
+ add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp);
+ efree(u_name.u);
param_count++;
tmp = master_to_zval(NULL, val);
if (val->name) {
- if (UG(unicode)) {
- UErrorCode status = U_ZERO_ERROR;
- zstr u_name;
- int u_name_len;
- zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)val->name, strlen((char*)val->name), &status);
- if (zend_u_hash_find(Z_ARRVAL_P(return_value), IS_UNICODE, u_name, u_name_len+1, (void**)&arr) == SUCCESS) {
- add_next_index_zval(*arr, tmp);
- } else if (val->next && get_node(val->next, (char*)val->name)) {
- zval *arr;
-
- MAKE_STD_ZVAL(arr);
- array_init(arr);
- add_next_index_zval(arr, tmp);
- add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, arr);
- } else {
- add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp);
- }
- efree(u_name.u);
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)val->name, strlen((char*)val->name), &status);
+ if (zend_u_hash_find(Z_ARRVAL_P(return_value), IS_UNICODE, u_name, u_name_len+1, (void**)&arr) == SUCCESS) {
+ add_next_index_zval(*arr, tmp);
+ } else if (val->next && get_node(val->next, (char*)val->name)) {
+ zval *arr;
+
+ MAKE_STD_ZVAL(arr);
+ array_init(arr);
+ add_next_index_zval(arr, tmp);
+ add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, arr);
} else {
- if (zend_hash_find(Z_ARRVAL_P(return_value), (char*)val->name, strlen((char*)val->name)+1, (void**)&arr) == SUCCESS) {
- add_next_index_zval(*arr, tmp);
- } else if (val->next && get_node(val->next, (char*)val->name)) {
- zval *arr;
-
- MAKE_STD_ZVAL(arr);
- array_init(arr);
- add_next_index_zval(arr, tmp);
- add_assoc_zval(return_value, (char*)val->name, arr);
- } else {
- add_assoc_zval(return_value, (char*)val->name, tmp);
- }
+ add_u_assoc_zval_ex(return_value, IS_UNICODE, u_name, u_name_len+1, tmp);
}
+ efree(u_name.u);
} else {
add_next_index_zval(return_value, tmp);
}
smart_str_free(&key);
}
val = master_to_zval(enc, trav);
- if (UG(unicode)) {
- UErrorCode status = U_ZERO_ERROR;
- zstr u_name;
- int u_name_len;
- zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)trav->name, strlen((char*)trav->name), &status);
- add_u_assoc_zval_ex(soap_headers, IS_UNICODE, u_name, u_name_len+1, val);
- efree(u_name.u);
- } else {
- add_assoc_zval(soap_headers, (char*)trav->name, val);
- }
+ UErrorCode status = U_ZERO_ERROR;
+ zstr u_name;
+ int u_name_len;
+ zend_string_to_unicode_ex(UG(utf8_conv), &u_name.u, &u_name_len, (char*)trav->name, strlen((char*)trav->name), &status);
+ add_u_assoc_zval_ex(soap_headers, IS_UNICODE, u_name, u_name_len+1, val);
+ efree(u_name.u);
}
trav = trav->next;
}
void soap_decode_string(zval *ret, char* str TSRMLS_DC)
{
- if (UG(unicode)) {
- /* TODO: unicode support */
- ZVAL_STRING(ret, str, 1);
- zval_string_to_unicode_ex(ret, UG(utf8_conv) TSRMLS_CC);
- } else if (SOAP_GLOBAL(encoding) != NULL) {
- xmlBufferPtr in = xmlBufferCreateStatic(str, strlen(str));
- xmlBufferPtr out = xmlBufferCreate();
- int n = xmlCharEncOutFunc(SOAP_GLOBAL(encoding), out, in);
-
- if (n >= 0) {
- ZVAL_STRING(ret, (char*)xmlBufferContent(out), 1);
- } else {
- ZVAL_STRING(ret, str, 1);
- }
- xmlBufferFree(out);
- xmlBufferFree(in);
- } else {
- ZVAL_STRING(ret, str, 1);
- }
+ /* TODO: unicode support */
+ ZVAL_STRING(ret, str, 1);
+ zval_string_to_unicode_ex(ret, UG(utf8_conv) TSRMLS_CC);
}
char* soap_encode_string_ex(zend_uchar type, zstr data, int len TSRMLS_DC)
zval_ptr_dtor(&trace);
RETVAL_STRINGL(str, len, 0);
- if (UG(unicode)) {
- zval_string_to_unicode(return_value TSRMLS_CC);
- }
+ zval_string_to_unicode(return_value TSRMLS_CC);
}
/* }}} */
INIT_ZVAL(param0);
params[0] = ¶m0;
ZVAL_STRINGL(params[0], buf, buf_size, 1);
- if (UG(unicode)) {
- zval_string_to_unicode_ex(params[0], UG(utf8_conv) TSRMLS_CC);
- }
+ zval_string_to_unicode_ex(params[0], UG(utf8_conv) TSRMLS_CC);
+
INIT_ZVAL(param1);
params[1] = ¶m1;
if (location == NULL) {
ZVAL_NULL(params[1]);
} else {
ZVAL_STRING(params[1], location, 1);
- if (UG(unicode)) {
- zval_string_to_unicode_ex(params[1], UG(utf8_conv) TSRMLS_CC);
- }
+ zval_string_to_unicode_ex(params[1], UG(utf8_conv) TSRMLS_CC);
}
INIT_ZVAL(param2);
params[2] = ¶m2;
ZVAL_NULL(params[2]);
} else {
ZVAL_STRING(params[2], action, 1);
- if (UG(unicode)) {
- zval_string_to_unicode_ex(params[2], UG(utf8_conv) TSRMLS_CC);
- }
+ zval_string_to_unicode_ex(params[2], UG(utf8_conv) TSRMLS_CC);
}
INIT_ZVAL(param3);
params[3] = ¶m3;
} else if (make_http_soap_request(this_ptr, buf.s, buf_size, location.s, action.s, version,
&Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC)) {
return_value->type = IS_STRING;
- if (UG(unicode)) {
- zval_string_to_unicode_ex(return_value, UG(utf8_conv) TSRMLS_CC);
- }
+ zval_string_to_unicode_ex(return_value, UG(utf8_conv) TSRMLS_CC);
}
if (buf_type == IS_UNICODE) {
efree(buf.s);
}
if (client->location) {
RETVAL_STRING(client->location, 1);
- if (UG(unicode)) {
- zval_string_to_unicode_ex(return_value, UG(utf8_conv) TSRMLS_CC);
- }
+ zval_string_to_unicode_ex(return_value, UG(utf8_conv) TSRMLS_CC);
efree(client->location);
client->location = NULL;
} else {
}
efree(class_file);
- return zend_u_hash_exists(EG(class_table), ZEND_STR_TYPE, lc_name, class_name_len+1);
+ return zend_u_hash_exists(EG(class_table), IS_UNICODE, lc_name, class_name_len+1);
}
}
efree(class_file);
zstr class_name, lc_name;
zstr file_exts = Z_UNIVAL(SPL_G(autoload_extensions));
int class_name_len, file_exts_len = Z_UNILEN(SPL_G(autoload_extensions)), found = 0;
- int unicode = UG(unicode);
zstr copy, pos1, pos2;
zval **original_return_value = EG(return_value_ptr_ptr);
zend_op **original_opline_ptr = EG(opline_ptr);
RETURN_FALSE;
}
- copy = pos1 = ezstrndup(ZEND_STR_TYPE, file_exts, file_exts_len);
- lc_name = zend_u_str_tolower_dup(ZEND_STR_TYPE, class_name, class_name_len);
- while(pos1.v && (unicode ? *pos1.u : *pos1.s) && !EG(exception)) {
+ copy = pos1 = ezstrndup(IS_UNICODE, file_exts, file_exts_len);
+ lc_name = zend_u_str_tolower_dup(IS_UNICODE, class_name, class_name_len);
+ while(pos1.v && *pos1.u && !EG(exception)) {
EG(return_value_ptr_ptr) = original_return_value;
EG(opline_ptr) = original_opline_ptr;
EG(active_op_array) = original_active_op_array;
- if (unicode) {
- pos2.u = u_strchr(pos1.u, ',');
- if (pos2.u) *pos2.u = '\0';
- } else {
- pos2.s = strchr(pos1.s, ',');
- if (pos2.s) *pos2.s = '\0';
+ pos2.u = u_strchr(pos1.u, ',');
+ if (pos2.u) {
+ *pos2.u = '\0';
}
if (spl_autoload(class_name, lc_name, class_name_len, pos1 TSRMLS_CC)) {
found = 1;
}
if (!pos2.v) {
pos1.v = NULL;
- } else if (unicode) {
+ } else {
pos1.u = pos2.u + 1;
- } else{
- pos1.s = pos2.s + 1;
}
}
efree(lc_name.v);
return;
}
zval_dtor(global);
- ZVAL_ZSTRL(global, ZEND_STR_TYPE, file_exts, file_exts_len, 1);
+ ZVAL_ZSTRL(global, IS_UNICODE, file_exts, file_exts_len, 1);
}
RETURN_ZVAL(global, 1, 0);
}
MAKE_STD_ZVAL(zclass_name);
- ZVAL_ZSTRL(zclass_name, ZEND_STR_TYPE, class_name, class_name_len, 1);
+ ZVAL_ZSTRL(zclass_name, IS_UNICODE, class_name, class_name_len, 1);
if (SPL_G(autoload_functions)) {
int l_autoload_running = SPL_G(autoload_running);
SPL_G(autoload_running) = 1;
- lc_name = zend_u_str_tolower_dup(ZEND_STR_TYPE, class_name, class_name_len);
+ lc_name = zend_u_str_tolower_dup(IS_UNICODE, class_name, class_name_len);
zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos);
while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS) {
func_name_type = zend_hash_get_current_key_ex(SPL_G(autoload_functions), &func_name, &func_name_len, &dummy, 0, &function_pos);
if (retval) {
zval_ptr_dtor(&retval);
}
- if (zend_u_hash_exists(EG(class_table), ZEND_STR_TYPE, lc_name, class_name_len+1)) {
+ if (zend_u_hash_exists(EG(class_table), IS_UNICODE, lc_name, class_name_len+1)) {
break;
}
zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos);
base = (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) ? spl_ce_ArrayIterator : spl_ce_ArrayObject;
zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1, &name_len TSRMLS_CC);
- zend_u_symtable_update(rv, ZEND_STR_TYPE, zname, name_len+1, &storage, sizeof(zval *), NULL);
+ zend_u_symtable_update(rv, IS_UNICODE, zname, name_len+1, &storage, sizeof(zval *), NULL);
efree(zname.v);
return rv;
if (Z_TYPE_P(intern->array) == IS_OBJECT) {
do {
- if (zend_hash_get_current_key_ex(aht, &string_key, &string_length, &num_key, 0, &intern->pos) == (UG(unicode)?HASH_KEY_IS_UNICODE:HASH_KEY_IS_STRING)) {
- if (!string_length ||
- ((UG(unicode) && string_key.u[0]) ||
- (!UG(unicode) && string_key.s[0]))) {
+ if (zend_hash_get_current_key_ex(aht, &string_key, &string_length, &num_key, 0, &intern->pos) == HASH_KEY_IS_UNICODE) {
+ if (!string_length || string_key.u[0]) {
return SUCCESS;
}
} else {
path = spl_filesystem_object_get_pathname(intern, &path_len, &path_type TSRMLS_CC);
pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "pathName", sizeof("pathName")-1, &pnlen TSRMLS_CC);
- add_u_assoc_zstrl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, path_type, path, path_len, 1);
+ add_u_assoc_zstrl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, path_type, path, path_len, 1);
efree(pnstr.v);
if (intern->file_name.v) {
pnstr = spl_gen_private_prop_name(spl_ce_SplFileInfo, "fileName", sizeof("fileName")-1, &pnlen TSRMLS_CC);
} else {
path.s = intern->file_name.s + path_len + 1;
}
- add_u_assoc_zstrl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->file_name_type, path, intern->file_name_len - (path_len + 1), 1);
+ add_u_assoc_zstrl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->file_name_type, path, intern->file_name_len - (path_len + 1), 1);
} else {
- add_u_assoc_zstrl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->file_name_type, intern->file_name, intern->file_name_len, 1);
+ add_u_assoc_zstrl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->file_name_type, intern->file_name, intern->file_name_len, 1);
}
efree(pnstr.v);
}
if (intern->type == SPL_FS_DIR) {
pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1, &pnlen TSRMLS_CC);
if (php_stream_is(intern->u.dir.dirp ,&php_glob_stream_ops)) {
- add_u_assoc_zstrl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->_path_type, intern->_path, intern->_path_len, 1);
+ add_u_assoc_zstrl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->_path_type, intern->_path, intern->_path_len, 1);
} else {
- add_u_assoc_bool_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, 0);
+ add_u_assoc_bool_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, 0);
}
efree(pnstr.v);
pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1, &pnlen TSRMLS_CC);
if (intern->u.dir.sub_path.v) {
- add_u_assoc_zstrl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->u.dir.sub_path_type, intern->u.dir.sub_path, intern->u.dir.sub_path_len, 1);
+ add_u_assoc_zstrl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->u.dir.sub_path_type, intern->u.dir.sub_path, intern->u.dir.sub_path_len, 1);
} else {
- add_u_assoc_zstrl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, ZEND_STR_TYPE, EMPTY_ZSTR, 0, 1);
+ add_u_assoc_zstrl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, IS_UNICODE, EMPTY_ZSTR, 0, 1);
}
efree(pnstr.v);
}
if (intern->type == SPL_FS_FILE) {
pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "openMode", sizeof("openMode")-1, &pnlen TSRMLS_CC);
- add_u_assoc_stringl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->u.file.open_mode, intern->u.file.open_mode_len, 1);
+ add_u_assoc_stringl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->u.file.open_mode, intern->u.file.open_mode_len, 1);
efree(pnstr.v);
stmp[1] = '\0';
stmp[0] = intern->u.file.delimiter;
pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "delimiter", sizeof("delimiter")-1, &pnlen TSRMLS_CC);
- add_u_assoc_stringl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, stmp, 1, 1);
+ add_u_assoc_stringl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, stmp, 1, 1);
efree(pnstr.v);
stmp[0] = intern->u.file.enclosure;
pnstr = spl_gen_private_prop_name(spl_ce_SplFileObject, "enclosure", sizeof("enclosure")-1, &pnlen TSRMLS_CC);
- add_u_assoc_stringl_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, stmp, 1, 1);
+ add_u_assoc_stringl_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, stmp, 1, 1);
efree(pnstr.v);
}
/* Append NULL to the end of the string */
buff[ret] = '\0';
- if (UG(unicode)) {
- if (SUCCESS == php_stream_path_decode(NULL, &target, &target_len, buff, ret, REPORT_ERRORS, FG(default_context))) {
- RETVAL_UNICODEL(target, target_len, 0);
- } else {
- RETVAL_STRING(buff, 1);
- }
+ if (SUCCESS == php_stream_path_decode(NULL, &target, &target_len, buff, ret, REPORT_ERRORS, FG(default_context))) {
+ RETVAL_UNICODEL(target, target_len, 0);
} else {
RETVAL_STRING(buff, 1);
}
RETVAL_FALSE;
} else
#endif
- if (UG(unicode)) {
- if (php_stream_path_decode(NULL, &path, &path_len, buff, strlen(buff), REPORT_ERRORS, FG(default_context)) == SUCCESS) {
- RETVAL_UNICODEL(path, path_len, 0);
- } else {
- RETVAL_STRING(buff, 1);
- }
+ if (php_stream_path_decode(NULL, &path, &path_len, buff, strlen(buff), REPORT_ERRORS, FG(default_context)) == SUCCESS) {
+ RETVAL_UNICODEL(path, path_len, 0);
} else {
RETVAL_STRING(buff, 1);
}
zval_unicode_to_string_ex(writeobj, ZEND_U_CONVERTER(((UConverter *)extra)) TSRMLS_CC);
return SUCCESS;
}
- if (type == IS_UNICODE && UG(unicode)) {
+ if (type == IS_UNICODE) {
ZVAL_ASCII_STRINGL(writeobj, intern->file_name.s, intern->file_name_len, 1);
return SUCCESS;
}
ZVAL_STRING(writeobj, intern->u.dir.entry.d_name, 1);
return SUCCESS;
}
- if (type == IS_UNICODE && UG(unicode)) {
+ if (type == IS_UNICODE) {
ZVAL_ASCII_STRING(writeobj, intern->u.dir.entry.d_name, 1);
return SUCCESS;
}
zend_hash_copy(rv, intern->std.properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1, &pnlen TSRMLS_CC);
- add_u_assoc_long_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->flags);
+ add_u_assoc_long_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->flags);
efree(pnstr.v);
ALLOC_INIT_ZVAL(dllist_array);
}
pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "dllist", sizeof("dllist")-1, &pnlen TSRMLS_CC);
- add_u_assoc_zval_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, dllist_array);
+ add_u_assoc_zval_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, dllist_array);
efree(pnstr.v);
return rv;
{
spl_instantiate(pce, retval, alloc TSRMLS_CC);
- zend_u_call_method(retval, pce, &pce->constructor, ZEND_STR_TYPE, pce->constructor->common.function_name, USTR_LEN(pce->constructor->common.function_name), NULL, 1, arg1, NULL TSRMLS_CC);
+ zend_u_call_method(retval, pce, &pce->constructor, IS_UNICODE, pce->constructor->common.function_name, USTR_LEN(pce->constructor->common.function_name), NULL, 1, arg1, NULL TSRMLS_CC);
return 0;
}
/* }}} */
{
spl_instantiate(pce, retval, alloc TSRMLS_CC);
- zend_u_call_method(retval, pce, &pce->constructor, ZEND_STR_TYPE, pce->constructor->common.function_name, USTR_LEN(pce->constructor->common.function_name), NULL, 2, arg1, arg2 TSRMLS_CC);
+ zend_u_call_method(retval, pce, &pce->constructor, IS_UNICODE, pce->constructor->common.function_name, USTR_LEN(pce->constructor->common.function_name), NULL, 2, arg1, arg2 TSRMLS_CC);
return 0;
}
/* }}} */
if (!allow || (allow > 0 && pce->ce_flags & ce_flags) || (allow < 0 && !(pce->ce_flags & ce_flags))) {
size_t len = pce->name_length;
zval *tmp;
- zend_uchar ztype = UG(unicode)?IS_UNICODE:IS_STRING;
- if (zend_u_hash_find(Z_ARRVAL_P(list), ztype, pce->name, len+1, (void*)&tmp) == FAILURE) {
+ if (zend_u_hash_find(Z_ARRVAL_P(list), IS_UNICODE, pce->name, len+1, (void*)&tmp) == FAILURE) {
MAKE_STD_ZVAL(tmp);
ZVAL_TEXTL(tmp, pce->name, pce->name_length, 1);
- zend_u_hash_add(Z_ARRVAL_P(list), ztype, pce->name, len+1, &tmp, sizeof(zval *), NULL);
+ zend_u_hash_add(Z_ARRVAL_P(list), IS_UNICODE, pce->name, len+1, &tmp, sizeof(zval *), NULL);
}
}
}
zstr rv;
zstr zprop;
- if (UG(unicode)) {
- zprop.u = zend_ascii_to_unicode(prop_name, prop_len + 1 ZEND_FILE_LINE_CC);
- zend_u_mangle_property_name(&rv, name_len, IS_UNICODE, ce->name, ce->name_length, zprop, prop_len, 0);
- efree(zprop.v);
- } else {
- zend_mangle_property_name(&rv.s, name_len, ce->name.s, ce->name_length, prop_name, prop_len, 0);
- }
+ zprop.u = zend_ascii_to_unicode(prop_name, prop_len + 1 ZEND_FILE_LINE_CC);
+ zend_u_mangle_property_name(&rv, name_len, IS_UNICODE, ce->name, ce->name_length, zprop, prop_len, 0);
+ efree(zprop.v);
return rv;
}
/* }}} */
zend_hash_copy(rv, intern->std.properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1, &pnlen TSRMLS_CC);
- add_u_assoc_long_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->flags);
+ add_u_assoc_long_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->flags);
efree(pnstr.v);
pnstr = spl_gen_private_prop_name(ce, "isCorrupted", sizeof("isCorrupted")-1, &pnlen TSRMLS_CC);
- add_u_assoc_bool_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, intern->heap->flags&SPL_HEAP_CORRUPTED);
+ add_u_assoc_bool_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, intern->heap->flags&SPL_HEAP_CORRUPTED);
efree(pnstr.v);
ALLOC_INIT_ZVAL(heap_array);
}
pnstr = spl_gen_private_prop_name(ce, "heap", sizeof("heap")-1, &pnlen TSRMLS_CC);
- add_u_assoc_zval_ex(&zrv, ZEND_STR_TYPE, pnstr, pnlen+1, heap_array);
+ add_u_assoc_zval_ex(&zrv, IS_UNICODE, pnstr, pnlen+1, heap_array);
efree(pnstr.v);
return rv;
function_handler = std_object_handlers.get_method(object_ptr, method, method_len TSRMLS_CC);
if (!function_handler) {
- if (zend_u_hash_find(&Z_OBJCE_P(zobj)->function_table, UG(unicode)?IS_UNICODE:IS_STRING, method, method_len+1, (void **) &function_handler) == FAILURE) {
+ if (zend_u_hash_find(&Z_OBJCE_P(zobj)->function_table, IS_UNICODE, method, method_len+1, (void **) &function_handler) == FAILURE) {
if (Z_OBJ_HT_P(zobj)->get_method) {
*object_ptr = zobj;
function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len TSRMLS_CC);
zval_dtor(return_value);
ZVAL_STRINGL(return_value, "Array", sizeof("Array")-1, 1);
} else if (Z_TYPE_PP(data) != IS_UNICODE && Z_TYPE_PP(data) != IS_STRING) {
- convert_to_text(return_value);
+ convert_to_unicode(return_value);
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
}
SPL_METHOD(RecursiveTreeIterator, getPrefix)
{
spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
- zend_uchar return_type = (UG(unicode) ? IS_UNICODE : IS_STRING);
- spl_recursive_tree_iterator_get_prefix(object, return_value, return_type TSRMLS_CC);
+ spl_recursive_tree_iterator_get_prefix(object, return_value, IS_UNICODE TSRMLS_CC);
} /* }}} */
/* {{{ proto string RecursiveTreeIterator::getEntry() U
SPL_METHOD(RecursiveTreeIterator, getPostfix)
{
spl_recursive_it_object *object = (spl_recursive_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
- zend_uchar return_type = (UG(unicode) ? IS_UNICODE : IS_STRING);
- spl_recursive_tree_iterator_get_postfix(object, return_value, return_type TSRMLS_CC);
+ spl_recursive_tree_iterator_get_postfix(object, return_value, IS_UNICODE TSRMLS_CC);
} /* }}} */
/* {{{ proto mixed RecursiveTreeIterator::current() U
}
if (Z_TYPE(key) != IS_UNICODE && Z_TYPE(key) != IS_STRING) {
- convert_to_text(&key);
+ convert_to_unicode(&key);
}
return_type = Z_TYPE(key);
function_handler = std_object_handlers.get_method(object_ptr, method, method_len TSRMLS_CC);
if (!function_handler) {
- if (zend_u_hash_find(&intern->inner.ce->function_table, UG(unicode)?IS_UNICODE:IS_STRING, method, method_len+1, (void **) &function_handler) == FAILURE) {
+ if (zend_u_hash_find(&intern->inner.ce->function_table, IS_UNICODE, method, method_len+1, (void **) &function_handler) == FAILURE) {
if (Z_OBJ_HT_P(intern->inner.zobject)->get_method) {
*object_ptr = intern->inner.zobject;
function_handler = Z_OBJ_HT_P(*object_ptr)->get_method(object_ptr, method, method_len TSRMLS_CC);
}
intern->u.regex.mode = mode;
intern->u.regex.regex = estrndup(regex, regex_len);
- intern->u.regex.pce = pcre_get_compiled_regex_cache(ZEND_STR_TYPE, regex, regex_len TSRMLS_CC);
+ intern->u.regex.pce = pcre_get_compiled_regex_cache(IS_UNICODE, regex, regex_len TSRMLS_CC);
if (intern->u.regex.pce == NULL) {
/* pcre_get_compiled_regex_cache has already sent error */
zend_restore_error_handling(&error_handling TSRMLS_CC);
}
zval_ptr_dtor(&intern->current.data);
ALLOC_INIT_ZVAL(intern->current.data);
- php_pcre_match_impl(intern->u.regex.pce, ZEND_STR_TYPE, subject, subject_len, &zcount,
+ php_pcre_match_impl(intern->u.regex.pce, IS_UNICODE, subject, subject_len, &zcount,
intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC);
count = zend_hash_num_elements(Z_ARRVAL_P(intern->current.data));
RETVAL_BOOL(count > 0);
}
zval_ptr_dtor(&intern->current.data);
ALLOC_INIT_ZVAL(intern->current.data);
- php_pcre_split_impl(intern->u.regex.pce, ZEND_STR_TYPE, subject, subject_len, intern->current.data, -1, intern->u.regex.preg_flags TSRMLS_CC);
+ php_pcre_split_impl(intern->u.regex.pce, IS_UNICODE, subject, subject_len, intern->current.data, -1, intern->u.regex.preg_flags TSRMLS_CC);
count = zend_hash_num_elements(Z_ARRVAL_P(intern->current.data));
RETVAL_BOOL(count > 1);
break;
case REGIT_MODE_REPLACE:
replacement = zend_read_property(intern->std.ce, getThis(), "replacement", sizeof("replacement")-1, 1 TSRMLS_CC);
- result = php_pcre_replace_impl(intern->u.regex.pce, ZEND_STR_TYPE, subject, subject_len, replacement, 0, &result_len, 0, NULL TSRMLS_CC);
+ result = php_pcre_replace_impl(intern->u.regex.pce, IS_UNICODE, subject, subject_len, replacement, 0, &result_len, 0, NULL TSRMLS_CC);
if (intern->u.regex.flags & REGIT_USE_KEY) {
if (intern->current.key_type != HASH_KEY_IS_LONG) {
} else {
*intern->u.caching.zstr = *intern->current.data;
}
- if (UG(unicode)) {
- zend_make_unicode_zval(intern->u.caching.zstr, &expr_copy, &use_copy);
- } else {
- zend_make_string_zval(intern->u.caching.zstr, &expr_copy, &use_copy);
- }
+ zend_make_unicode_zval(intern->u.caching.zstr, &expr_copy, &use_copy);
if (use_copy) {
*intern->u.caching.zstr = expr_copy;
INIT_PZVAL(intern->u.caching.zstr);
RETURN_UNICODEL(intern->current.str_key.u, intern->current.str_key_len-1, 1);
} else {
RETVAL_LONG(intern->current.int_key);
- convert_to_text(return_value);
+ convert_to_unicode(return_value);
return;
}
} else if (intern->u.caching.flags & CIT_TOSTRING_USE_CURRENT) {
*return_value = *intern->current.data;
zval_copy_ctor(return_value);
- convert_to_text(return_value);
+ convert_to_unicode(return_value);
INIT_PZVAL(return_value);
return;
}
}
zname = spl_gen_private_prop_name(spl_ce_SplObjectStorage, "storage", sizeof("storage")-1, &name_len TSRMLS_CC);
- zend_u_symtable_update(rv, ZEND_STR_TYPE, zname, name_len+1, &storage, sizeof(zval *), NULL);
+ zend_u_symtable_update(rv, IS_UNICODE, zname, name_len+1, &storage, sizeof(zval *), NULL);
efree(zname.v);
return rv;
}
if (result_type == PHPSQLITE_ASSOC) {
- if (UG(unicode) &&
- SUCCESS == zend_string_to_unicode(SQLITE2_CONV, &(colname.u), &colname_len, (char*)colnames[i], strlen((char*)colnames[i]) TSRMLS_CC)) {
+ if (SUCCESS == zend_string_to_unicode(SQLITE2_CONV, &(colname.u), &colname_len, (char*)colnames[i], strlen((char*)colnames[i]) TSRMLS_CC)) {
colname_type = IS_UNICODE;
if (SQLITE_G(assoc_case) == 1) {
UChar *tmp;
Z_ADDREF_P(decoded);
- if (UG(unicode) &&
- SUCCESS == zend_string_to_unicode(SQLITE2_CONV, &colname, &colname_len, (char*)colnames[j], strlen((char*)colnames[j]) TSRMLS_CC)) {
+ if (SUCCESS == zend_string_to_unicode(SQLITE2_CONV, &colname, &colname_len, (char*)colnames[j], strlen((char*)colnames[j]) TSRMLS_CC)) {
add_u_assoc_zval_ex(return_value, IS_UNICODE, ZSTR(colname), colname_len + 1, decoded);
efree(colname);
} else {
{
Z_UNILEN_P(result) = Z_UNILEN_P(prefix) + (add_underscore ? 1 : 0) + var_name_len;
- if (UG(unicode)) {
- Z_TYPE_P(result) = IS_UNICODE;
- Z_USTRVAL_P(result) = eumalloc(Z_USTRLEN_P(result) + 1);
- u_memcpy(Z_USTRVAL_P(result), Z_USTRVAL_P(prefix), Z_USTRLEN_P(prefix));
+ Z_TYPE_P(result) = IS_UNICODE;
+ Z_USTRVAL_P(result) = eumalloc(Z_USTRLEN_P(result) + 1);
+ u_memcpy(Z_USTRVAL_P(result), Z_USTRVAL_P(prefix), Z_USTRLEN_P(prefix));
- if (add_underscore) {
- Z_USTRVAL_P(result)[Z_USTRLEN_P(prefix)] = (UChar) 0x5f /*'_'*/;
- }
+ if (add_underscore) {
+ Z_USTRVAL_P(result)[Z_USTRLEN_P(prefix)] = (UChar) 0x5f /*'_'*/;
+ }
- if (var_name_type == IS_UNICODE) {
- u_memcpy(Z_USTRVAL_P(result)+Z_USTRLEN_P(prefix) + (add_underscore ? 1 : 0), var_name.u, var_name_len + 1);
- } else {
- UChar *buf;
- int buf_len;
- UErrorCode status = U_ZERO_ERROR;
-
- zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
- &buf, &buf_len, var_name.s, var_name_len, &status);
- if (U_FAILURE(status)) {
- zval_dtor(result);
- ZVAL_NULL(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not convert variable name to Unicode string");
- return FAILURE;
- }
- if (buf_len > var_name_len) {
- Z_USTRLEN_P(result) = Z_USTRLEN_P(prefix) + (add_underscore ? 1 : 0) + buf_len;
- Z_USTRVAL_P(result) = eurealloc(Z_USTRVAL_P(result), Z_USTRLEN_P(result) + 1);
- }
- u_memcpy(Z_USTRVAL_P(result)+Z_USTRLEN_P(prefix) + (add_underscore ? 1 : 0), buf, buf_len + 1);
- efree(buf);
- }
+ if (var_name_type == IS_UNICODE) {
+ u_memcpy(Z_USTRVAL_P(result)+Z_USTRLEN_P(prefix) + (add_underscore ? 1 : 0), var_name.u, var_name_len + 1);
} else {
- Z_TYPE_P(result) = IS_STRING;
- Z_STRVAL_P(result) = emalloc(Z_STRLEN_P(result) + 1);
- memcpy(Z_STRVAL_P(result), Z_STRVAL_P(prefix), Z_STRLEN_P(prefix));
+ UChar *buf;
+ int buf_len;
+ UErrorCode status = U_ZERO_ERROR;
- if (add_underscore) {
- Z_STRVAL_P(result)[Z_STRLEN_P(prefix)] = '_';
+ zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)),
+ &buf, &buf_len, var_name.s, var_name_len, &status);
+ if (U_FAILURE(status)) {
+ zval_dtor(result);
+ ZVAL_NULL(result);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not convert variable name to Unicode string");
+ return FAILURE;
}
-
- if (var_name_type == IS_STRING) {
- memcpy(Z_STRVAL_P(result) + Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0), var_name.s, var_name_len + 1);
- } else {
- char *buf;
- int buf_len;
- UErrorCode status = U_ZERO_ERROR;
-
- zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &buf, &buf_len, var_name.u, var_name_len, &status);
- if (U_FAILURE(status)) {
- zval_dtor(result);
- ZVAL_NULL(result);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not convert variable name to string");
- return FAILURE;
- }
- if (buf_len > var_name_len) {
- Z_STRLEN_P(result) = Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0) + buf_len;
- Z_STRVAL_P(result) = erealloc(Z_STRVAL_P(result), Z_STRLEN_P(result) + 1);
- }
- memcpy(Z_STRVAL_P(result) + Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0), buf, buf_len + 1);
- efree(buf);
+ if (buf_len > var_name_len) {
+ Z_USTRLEN_P(result) = Z_USTRLEN_P(prefix) + (add_underscore ? 1 : 0) + buf_len;
+ Z_USTRVAL_P(result) = eurealloc(Z_USTRVAL_P(result), Z_USTRLEN_P(result) + 1);
}
+ u_memcpy(Z_USTRVAL_P(result)+Z_USTRLEN_P(prefix) + (add_underscore ? 1 : 0), buf, buf_len + 1);
+ efree(buf);
}
-
return SUCCESS;
}
/* }}} */
}
if (prefix) {
- convert_to_text(prefix);
+ convert_to_unicode(prefix);
if (Z_UNILEN_P(prefix) && !php_valid_var_name(Z_UNIVAL_P(prefix), Z_UNILEN_P(prefix), Z_TYPE_P(prefix))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "prefix is not a valid identifier");
return;
zval num;
ZVAL_LONG(&num, num_key);
- convert_to_text(&num);
+ convert_to_unicode(&num);
php_prefix_varname(&final_name, prefix, Z_UNIVAL(num), Z_UNILEN(num), Z_TYPE(num), 1 TSRMLS_CC);
zval_dtor(&num);
} else {
break;
}
- if (UG(unicode) && Z_TYPE(final_name) == IS_STRING) {
+ if (Z_TYPE(final_name) == IS_STRING) {
convert_to_unicode(&final_name);
- } else if (!UG(unicode) && Z_TYPE(final_name) == IS_UNICODE) {
- convert_to_string(&final_name);
}
if (Z_TYPE(final_name) != IS_NULL && php_valid_var_name(Z_UNIVAL(final_name), Z_UNILEN(final_name), Z_TYPE(final_name))) {
if (Z_TYPE_PP(entry) != IS_STRING && Z_TYPE_PP(entry) != IS_UNICODE) {
key = **entry;
zval_copy_ctor(&key);
- convert_to_text(&key);
+ convert_to_unicode(&key);
key_ptr = &key;
}
}
RETURN_FALSE;
case IS_NULL:
- if (zend_u_hash_exists(array, (UG(unicode) ? IS_UNICODE : IS_STRING), EMPTY_ZSTR, 1)) {
+ if (zend_u_hash_exists(array, IS_UNICODE, EMPTY_ZSTR, 1)) {
RETURN_TRUE;
}
RETURN_FALSE;
if (Z_TYPE_PP(entry_keys) != IS_STRING && Z_TYPE_PP(entry_keys) != IS_UNICODE) {
key = **entry_keys;
zval_copy_ctor(&key);
- convert_to_text(&key);
+ convert_to_unicode(&key);
key_ptr = &key;
}
RETURN_FALSE;
}
- convert_to_text(callback);
+ convert_to_unicode(callback);
if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) {
if (retval_ptr) {
RETURN_FALSE;
}
- convert_to_text(callback);
+ convert_to_unicode(callback);
params_ar = HASH_OF(params);
num_elems = zend_hash_num_elements(params_ar);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &expr, &i) == FAILURE) {
RETURN_FALSE;
}
- convert_to_text_ex(expr);
+ convert_to_unicode_ex(expr);
if (i) {
php_output_start_default(TSRMLS_C);
new_value.s = temp;
new_value_len = temp_len;
free_new_value = 1;
- } else if (UG(unicode)) {
+ } else {
UErrorCode status = U_ZERO_ERROR;
if (ucnv_getType(ZEND_U_CONVERTER(UG(filesystem_encoding_conv))) != UCNV_UTF8) {
}
if (Z_TYPE_P(tick_fe.arguments[0]) != IS_ARRAY && Z_TYPE_P(tick_fe.arguments[0]) != IS_OBJECT) {
- convert_to_text_ex(&tick_fe.arguments[0]);
+ convert_to_unicode_ex(&tick_fe.arguments[0]);
}
if (!BG(user_tick_functions)) {
}
if (Z_TYPE_P(function) != IS_ARRAY) {
- convert_to_text(function);
+ convert_to_unicode(function);
}
tick_fe.arguments = (zval **) emalloc(sizeof(zval *));
zval_copy_ctor(&name);
INIT_PZVAL(&name);
- if (UG(unicode)) {
- convert_to_unicode_with_converter(element, UG(utf8_conv));
- convert_to_unicode_with_converter(&name, UG(utf8_conv));
- }
- zend_u_symtable_update(Z_ARRVAL_P(arr), ZEND_STR_TYPE, Z_UNIVAL(name), Z_UNILEN(name) + 1, &element, sizeof(zval *), NULL);
+ convert_to_unicode_with_converter(element, UG(utf8_conv));
+ convert_to_unicode_with_converter(&name, UG(utf8_conv));
+
+ zend_u_symtable_update(Z_ARRVAL_P(arr), IS_UNICODE, Z_UNIVAL(name), Z_UNILEN(name) + 1, &element, sizeof(zval *), NULL);
zval_dtor(&name);
break;
zstr key;
int key_len;
- if (UG(unicode)) {
- if (zend_string_to_unicode(UG(utf8_conv), &key.u, &key_len, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) TSRMLS_CC) == FAILURE) {
- return;
- }
- } else {
- key.s = Z_STRVAL_P(arg1);
- key_len = Z_STRLEN_P(arg1);
+ if (zend_string_to_unicode(UG(utf8_conv), &key.u, &key_len, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) TSRMLS_CC) == FAILURE) {
+ return;
}
- if (zend_u_hash_find(Z_ARRVAL_P(arr), ZEND_STR_TYPE, key, key_len+1, (void **) &find_hash) == FAILURE) {
+ if (zend_u_hash_find(Z_ARRVAL_P(arr), IS_UNICODE, key, key_len+1, (void **) &find_hash) == FAILURE) {
ALLOC_ZVAL(hash);
INIT_PZVAL(hash);
array_init(hash);
- zend_u_hash_update(Z_ARRVAL_P(arr), ZEND_STR_TYPE, key, key_len+1, &hash, sizeof(zval *), NULL);
+ zend_u_hash_update(Z_ARRVAL_P(arr), IS_UNICODE, key, key_len+1, &hash, sizeof(zval *), NULL);
} else {
hash = *find_hash;
}
- if (UG(unicode)) {
- efree(key.u);
- }
+ efree(key.u);
}
if (Z_TYPE_P(hash) != IS_ARRAY) {
zval_copy_ctor(element);
INIT_PZVAL(element);
- if (UG(unicode)) {
- convert_to_unicode_with_converter(element, UG(utf8_conv));
- }
+ convert_to_unicode_with_converter(element, UG(utf8_conv));
if (arg3 && Z_STRLEN_P(arg3) > 0) {
add_assoc_zval_ex(hash, Z_STRVAL_P(arg3), Z_STRLEN_P(arg3) + 1, element);
zval_copy_ctor(&name);
INIT_PZVAL(&name);
- if (UG(unicode)) {
- convert_to_unicode_with_converter(&name, UG(utf8_conv));
- }
- zend_u_symtable_update(Z_ARRVAL_P(arr), ZEND_STR_TYPE, Z_UNIVAL(name), Z_UNILEN(name) + 1, &BG(active_ini_file_section), sizeof(zval *), NULL);
+ convert_to_unicode_with_converter(&name, UG(utf8_conv));
+
+ zend_u_symtable_update(Z_ARRVAL_P(arr), IS_UNICODE, Z_UNIVAL(name), Z_UNILEN(name) + 1, &BG(active_ini_file_section), sizeof(zval *), NULL);
zval_dtor(&name);
} else if (arg2) {
zval *active_arr;
} else {
zval num;
ZVAL_LONG(&num, hash_key->h);
- convert_to_text(&num);
+ convert_to_unicode(&num);
php_prefix_varname(&new_key, prefix, Z_UNIVAL(num), Z_UNILEN(num), Z_TYPE(num), 0 TSRMLS_CC);
zval_dtor(&num);
}
}
if (ZEND_NUM_ARGS() > 1) {
- convert_to_text(prefix);
+ convert_to_unicode(prefix);
if (Z_UNILEN_P(prefix) == 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix specified - possible security hazard");
array_init(return_value);
for (n = 0; n < globbuf.gl_pathc; n++) {
+ UChar *path;
+ int path_len;
+
if (PG(open_basedir) && *PG(open_basedir)) {
if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0 TSRMLS_CC)) {
basedir_limit = 1;
continue;
}
}
- if (UG(unicode)) {
- UChar *path;
- int path_len;
-
- if (SUCCESS == php_stream_path_decode(&php_plain_files_wrapper, &path, &path_len, globbuf.gl_pathv[n]+cwd_skip,
- strlen(globbuf.gl_pathv[n]+cwd_skip), REPORT_ERRORS, FG(default_context))) {
- add_next_index_unicodel(return_value, path, path_len, 0);
- } else {
- /* Fallback on string version, path_decode will emit warning */
- add_next_index_string(return_value, globbuf.gl_pathv[n]+cwd_skip, 1);
- }
+
+ if (SUCCESS == php_stream_path_decode(&php_plain_files_wrapper, &path, &path_len, globbuf.gl_pathv[n]+cwd_skip,
+ strlen(globbuf.gl_pathv[n]+cwd_skip), REPORT_ERRORS, FG(default_context))) {
+ add_next_index_unicodel(return_value, path, path_len, 0);
} else {
+ /* Fallback on string version, path_decode will emit warning */
add_next_index_string(return_value, globbuf.gl_pathv[n]+cwd_skip, 1);
}
}
array_init(return_value);
for (i = 0; i < n; i++) {
- if (UG(unicode)) {
- UChar *path;
- int path_len;
-
- if (SUCCESS == php_stream_path_decode(NULL, &path, &path_len, namelist[i], strlen(namelist[i]), REPORT_ERRORS, context)) {
- add_next_index_unicodel(return_value, path, path_len, 0);
- efree(namelist[i]);
- } else {
- /* Fallback on using the non-unicode version, path_decode will emit the warning for us */
- add_next_index_string(return_value, namelist[i], 0);
- }
+ UChar *path;
+ int path_len;
+
+ if (SUCCESS == php_stream_path_decode(NULL, &path, &path_len, namelist[i], strlen(namelist[i]), REPORT_ERRORS, context)) {
+ add_next_index_unicodel(return_value, path, path_len, 0);
+ efree(namelist[i]);
} else {
+ /* Fallback on using the non-unicode version, path_decode will emit the warning for us */
add_next_index_string(return_value, namelist[i], 0);
}
}
int filename_len;
zval *data;
int numchars = 0;
- long flags = ((argc < 3) && UG(unicode)) ? PHP_FILE_TEXT : 0;
+ long flags = (argc < 3) ? PHP_FILE_TEXT : 0;
zval *zcontext = NULL;
php_stream_context *context = NULL;
char mode[3] = { 'w', 0, 0 };
}
if ((fd = php_open_temporary_fd(dir, p, &opened_path TSRMLS_CC)) >= 0) {
+ UChar *utmpnam;
+ int utmpnam_len;
+
close(fd);
- if (UG(unicode)) {
- UChar *utmpnam;
- int utmpnam_len;
- if (SUCCESS == php_stream_path_decode(NULL, &utmpnam, &utmpnam_len, opened_path, strlen(opened_path), REPORT_ERRORS, FG(default_context))) {
- RETVAL_UNICODEL(utmpnam, utmpnam_len, 0);
- }
- efree(opened_path);
- } else {
- RETVAL_STRING(opened_path, 0);
+ if (SUCCESS == php_stream_path_decode(NULL, &utmpnam, &utmpnam_len, opened_path, strlen(opened_path), REPORT_ERRORS, FG(default_context))) {
+ RETVAL_UNICODEL(utmpnam, utmpnam_len, 0);
}
+ efree(opened_path);
}
efree(p);
}
#ifdef ZTS
if (VCWD_ACCESS(resolved_path_buff, F_OK)) {
RETVAL_FALSE;
- } else
+ } else
#endif
-
- if (UG(unicode)) {
+ {
UChar *path;
int path_len;
/* Fallback */
RETVAL_STRING(resolved_path_buff, 1);
}
- } else {
- RETVAL_STRING(resolved_path_buff, 1);
}
} else {
RETVAL_FALSE;
char *temp_dir = (char *)php_get_temporary_directory();
int temp_dir_len = strlen(temp_dir), utemp_dir_len;
- if (!UG(unicode)) {
- RETURN_STRINGL(temp_dir, temp_dir_len, 1);
- }
-
/* else UG(unicode) */
if (FAILURE == php_stream_path_decode(NULL, &utemp_dir, &utemp_dir_len, temp_dir, temp_dir_len, REPORT_ERRORS, FG(default_context))) {
RETURN_FALSE;
int len;
zstr result;
- if (!UG(unicode)) {
- if ((result.s = php_formatted_print(ht, &len, 0, 0, PHP_RUNTIME TSRMLS_CC))==NULL) {
- RETURN_FALSE;
- }
- RETVAL_STRINGL(result.s, len, 0);
- } else {
- result = php_u_formatted_print(ht, &len, 0, 0, PHP_RUNTIME TSRMLS_CC);
- if (result.v == NULL) {
- RETURN_FALSE;
- }
- RETVAL_UNICODEL(result.u, len, 0);
+ result = php_u_formatted_print(ht, &len, 0, 0, PHP_RUNTIME TSRMLS_CC);
+ if (result.v == NULL) {
+ RETURN_FALSE;
}
+ RETVAL_UNICODEL(result.u, len, 0);
}
/* }}} */
int len;
zstr result;
- if (!UG(unicode)) {
- if ((result.s = php_formatted_print(ht, &len, 1, 0, PHP_RUNTIME TSRMLS_CC))==NULL) {
- RETURN_FALSE;
- }
- RETVAL_STRINGL(result.s, len, 0);
- } else {
- result = php_u_formatted_print(ht, &len, 1, 0, PHP_RUNTIME TSRMLS_CC);
- if (result.v == NULL) {
- RETURN_FALSE;
- }
- RETVAL_UNICODEL(result.u, len, 0);
+ result = php_u_formatted_print(ht, &len, 1, 0, PHP_RUNTIME TSRMLS_CC);
+ if (result.v == NULL) {
+ RETURN_FALSE;
}
+ RETVAL_UNICODEL(result.u, len, 0);
}
/* }}} */
int len;
zstr result;
- if (!UG(unicode)) {
- if ((result.s = php_formatted_print(ht, &len, 0, 0, PHP_OUTPUT TSRMLS_CC))==NULL) {
- RETURN_FALSE;
- }
- } else {
- result = php_u_formatted_print(ht, &len, 0, 0, PHP_OUTPUT TSRMLS_CC);
- if (result.v == NULL) {
- RETURN_FALSE;
- }
+ result = php_u_formatted_print(ht, &len, 0, 0, PHP_OUTPUT TSRMLS_CC);
+ if (result.v == NULL) {
+ RETURN_FALSE;
}
PHPWRITE(result.s, len);
{
int len;
zstr result;
-
- if (!UG(unicode)) {
- if ((result.s = php_formatted_print(ht, &len, 1, 0, PHP_OUTPUT TSRMLS_CC))==NULL) {
- RETURN_FALSE;
- }
- } else {
- result = php_u_formatted_print(ht, &len, 1, 0, PHP_OUTPUT TSRMLS_CC);
- if (result.v == NULL) {
- RETURN_FALSE;
- }
+
+ result = php_u_formatted_print(ht, &len, 1, 0, PHP_OUTPUT TSRMLS_CC);
+ if (result.v == NULL) {
+ RETURN_FALSE;
}
PHPWRITE(result.s, len);
php_stream_from_zval(stream, &arg1);
if (Z_TYPE_PP(arg2) != IS_STRING && Z_TYPE_PP(arg2) != IS_UNICODE) {
- convert_to_text_ex(arg2);
+ convert_to_unicode_ex(arg2);
}
if (Z_TYPE_PP(arg2) == IS_STRING) {
php_stream_from_zval(stream, &arg1);
if (Z_TYPE_PP(arg2) != IS_STRING && Z_TYPE_PP(arg2) != IS_UNICODE) {
- convert_to_text_ex(arg2);
+ convert_to_unicode_ex(arg2);
}
if (Z_TYPE_PP(arg2) == IS_STRING) {
case 2:
zval_dtor(arg2);
ZVAL_LONG(arg2, line);
- case 1:
- zval_dtor(arg1);
- if (UG(unicode)) {
+ case 1: {
UChar *ufile;
int ufile_len;
+ zval_dtor(arg1);
+
if (file && SUCCESS == php_stream_path_decode(NULL, &ufile, &ufile_len, file, strlen(file), REPORT_ERRORS, FG(default_context))) {
ZVAL_UNICODEL(arg1, ufile, ufile_len, 0);
} else {
ZVAL_EMPTY_UNICODE(arg1);
}
- } else {
- if (file) {
- ZVAL_STRING(arg1, file, 1);
- } else {
- ZVAL_STRING(arg1, "", 1);
- }
}
break;
}
return;
}
- if (UG(unicode)) {
- charset = cs_utf_8;
- }
+ charset = cs_utf_8;
array_init(return_value);
if (entity_map[j].table[i] == NULL)
continue;
- if (UG(unicode)) {
- cp = (UChar)(i + entity_map[j].basechar);
- key_len = zend_codepoint_to_uchar(cp, key);
- key[key_len] = 0;
- snprintf(buffer, sizeof(buffer), "&%s;", entity_map[j].table[i]);
- add_u_assoc_ascii_string_ex(return_value, IS_UNICODE, ZSTR(key), key_len+1, buffer, 1);
- } else {
- /* no wide chars here, because charset is always cs_8859_1 */
- ind[0] = i + entity_map[j].basechar;
- snprintf(buffer, sizeof(buffer), "&%s;", entity_map[j].table[i]);
- add_assoc_string(return_value, ind, buffer, 1);
- }
+ cp = (UChar)(i + entity_map[j].basechar);
+ key_len = zend_codepoint_to_uchar(cp, key);
+ key[key_len] = 0;
+ snprintf(buffer, sizeof(buffer), "&%s;", entity_map[j].table[i]);
+ add_u_assoc_ascii_string_ex(return_value, IS_UNICODE, ZSTR(key), key_len+1, buffer, 1);
}
}
/* break thru */
strlcpy(location, http_header_line + 10, sizeof(location));
} else if (!strncasecmp(http_header_line, "Content-Type: ", 14)) {
- if (UG(unicode) && strchr(mode, 't')) {
+ if (strchr(mode, 't')) {
charset = php_http_detect_charset(http_header_line + sizeof("Content-type: "));
}
}
if (charset) {
- if (stream && UG(unicode) && strchr(mode, 't')) {
+ if (stream && strchr(mode, 't')) {
php_stream_encoding_apply(stream, 0, charset, UG(to_error_mode), NULL);
}
efree(charset);
object_properties = Z_OBJPROP_P(object);
if (zend_hash_find(object_properties, MAGIC_MEMBER, sizeof(MAGIC_MEMBER), (void **) &val) == SUCCESS) {
- if (UG(unicode)) {
- retval.u = eustrndup(Z_USTRVAL_PP(val), Z_USTRLEN_PP(val));
- } else {
- retval.s = estrndup(Z_STRVAL_PP(val), Z_STRLEN_PP(val));
- }
+ retval.u = eustrndup(Z_USTRVAL_PP(val), Z_USTRLEN_PP(val));
if (nlen) {
*nlen = Z_UNILEN_PP(val);
/* Append NULL to the end of the string */
buff[ret] = '\0';
- if (UG(unicode)) {
- if (SUCCESS == php_stream_path_decode(NULL, &target, &target_len, buff, strlen(buff), REPORT_ERRORS, FG(default_context))) {
- RETURN_UNICODEL(target, target_len, 0);
- } else {
- RETURN_FALSE;
- }
+ if (SUCCESS == php_stream_path_decode(NULL, &target, &target_len, buff, strlen(buff), REPORT_ERRORS, FG(default_context))) {
+ RETURN_UNICODEL(target, target_len, 0);
} else {
- RETURN_STRING(buff, 1);
+ RETURN_FALSE;
}
}
/* }}} */
class_name = php_lookup_class_name(struc, &name_len); \
if (!class_name.v) { \
name_len = sizeof(INCOMPLETE_CLASS) - 1; \
- if (UG(unicode)) { \
- class_name.u = USTR_MAKE(INCOMPLETE_CLASS); \
- } else { \
- class_name.s = estrndup(INCOMPLETE_CLASS, name_len); \
- } \
+ class_name.u = USTR_MAKE(INCOMPLETE_CLASS); \
} \
free_class_name = 1; \
incomplete_class = 1; \
int wstatus;
pid_t wait_pid;
#endif
+ UChar *ucmd;
+ int ucmd_len;
int running = 1, signaled = 0, stopped = 0;
int exitcode = -1, termsig = 0, stopsig = 0;
array_init(return_value);
- if (UG(unicode)) {
- UChar *ucmd;
- int ucmd_len;
-
- if (SUCCESS == php_stream_path_decode(&php_plain_files_wrapper, &ucmd, &ucmd_len, proc->command, strlen(proc->command), REPORT_ERRORS, FG(default_context))) {
- add_ascii_assoc_unicodel(return_value, "command", ucmd, ucmd_len, 0);
- } else {
- /* Fallback on original binary string */
- add_ascii_assoc_string(return_value, "command", proc->command, 1);
- }
+ if (SUCCESS == php_stream_path_decode(&php_plain_files_wrapper, &ucmd, &ucmd_len, proc->command, strlen(proc->command), REPORT_ERRORS, FG(default_context))) {
+ add_ascii_assoc_unicodel(return_value, "command", ucmd, ucmd_len, 0);
} else {
+ /* Fallback on original binary string */
add_ascii_assoc_string(return_value, "command", proc->command, 1);
}
add_ascii_assoc_long(return_value, "pid", (long) proc->child);
/* nasty hack; don't copy it */
stream->flags |= PHP_STREAM_FLAG_NO_SEEK;
- if (UG(unicode) && !binary_pipes) {
+ if (!binary_pipes) {
if (write_stream) {
char *encoding = (context && context->output_encoding) ? context->output_encoding : UG(stream_encoding);
add_ascii_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0);
if (stream->orig_path) {
- if (UG(unicode)) {
- UChar *decoded_path = NULL;
- int decoded_path_len = 0;
-
- if (SUCCESS == php_stream_path_decode(stream->wrapper, &decoded_path, &decoded_path_len, stream->orig_path, strlen(stream->orig_path), REPORT_ERRORS, stream->context)) {
- add_ascii_assoc_unicodel(return_value, "uri", decoded_path, decoded_path_len, 0);
- } else {
- add_ascii_assoc_null(return_value, "uri");
- }
+ UChar *decoded_path = NULL;
+ int decoded_path_len = 0;
+
+ if (SUCCESS == php_stream_path_decode(stream->wrapper, &decoded_path, &decoded_path_len, stream->orig_path, strlen(stream->orig_path), REPORT_ERRORS, stream->context)) {
+ add_ascii_assoc_unicodel(return_value, "uri", decoded_path, decoded_path_len, 0);
} else {
- add_ascii_assoc_string(return_value, "uri", stream->orig_path, 1);
+ add_ascii_assoc_null(return_value, "uri");
}
}
while (ptr < end) {
char *s = strchr(ptr, DEFAULT_DIR_SEPARATOR);
+ UChar *upath;
+ int upath_len;
if (!s) {
s = end;
continue;
}
- if (UG(unicode)) {
- UChar *upath;
- int upath_len;
-
- if (SUCCESS == php_stream_path_decode(NULL, &upath, &upath_len, buffer, (s - ptr) + 1 + filename_len, REPORT_ERRORS, context)) {
- RETURN_UNICODEL(upath, upath_len, 0);
- } else {
- /* Fallback */
- RETURN_STRINGL(buffer, (s - ptr) + 1 + filename_len, 1);
- }
+ if (SUCCESS == php_stream_path_decode(NULL, &upath, &upath_len, buffer, (s - ptr) + 1 + filename_len, REPORT_ERRORS, context)) {
+ RETURN_UNICODEL(upath, upath_len, 0);
} else {
+ /* Fallback */
RETURN_STRINGL(buffer, (s - ptr) + 1 + filename_len, 1);
}
}
return;
}
- if (UG(unicode)) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "deprecated in Unicode mode, please use ICU locale functions");
- }
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "deprecated in Unicode mode, please use ICU locale functions");
switch(item) { /* {{{ */
#ifdef ABDAY_1
SEPARATE_ZVAL(arg1);
arr = *arg1;
MAKE_STD_ZVAL(delim);
- if (UG(unicode)) {
- ZVAL_UNICODEL(delim, EMPTY_STR, sizeof("")-1, 0);
- } else {
- ZVAL_STRINGL(delim, "", sizeof("")-1, 0);
- }
+ ZVAL_UNICODEL(delim, EMPTY_STR, sizeof("")-1, 0);
}
} else {
if (Z_TYPE_PP(arg1) == IS_ARRAY) {
SEPARATE_ZVAL(arg1);
arr = *arg1;
if (Z_TYPE_PP(arg2) != IS_UNICODE && Z_TYPE_PP(arg2) != IS_STRING) {
- convert_to_text_ex(arg2);
+ convert_to_unicode_ex(arg2);
}
delim = *arg2;
} else if (Z_TYPE_PP(arg2) == IS_ARRAY) {
SEPARATE_ZVAL(arg2);
arr = *arg2;
if (Z_TYPE_PP(arg1) != IS_UNICODE && Z_TYPE_PP(arg1) != IS_STRING) {
- convert_to_text_ex(arg1);
+ convert_to_unicode_ex(arg1);
}
delim = *arg1;
} else {
SEPARATE_ZVAL(needle);
if (Z_TYPE_PP(haystack) != IS_UNICODE && Z_TYPE_PP(haystack) != IS_STRING) {
- convert_to_text_ex(haystack);
+ convert_to_unicode_ex(haystack);
}
if (Z_TYPE_PP(needle) == IS_UNICODE || Z_TYPE_PP(needle) == IS_STRING) {
}
if (Z_TYPE_PP(haystack) != IS_UNICODE && Z_TYPE_PP(haystack) != IS_STRING) {
- convert_to_text_ex(haystack);
+ convert_to_unicode_ex(haystack);
}
/*
}
if (Z_TYPE_PP(zhaystack) != IS_UNICODE && Z_TYPE_PP(zhaystack) != IS_STRING) {
- convert_to_text_ex(zhaystack);
+ convert_to_unicode_ex(zhaystack);
}
if (Z_TYPE_PP(zneedle) == IS_UNICODE || Z_TYPE_PP(zneedle) == IS_STRING) {
if (Z_TYPE_PP(zneedle) != Z_TYPE_PP(zhaystack)) {
return;
}
if (Z_TYPE_P(haystack) != IS_UNICODE || Z_TYPE_P(haystack) != IS_STRING) {
- convert_to_text(haystack);
+ convert_to_unicode(haystack);
}
if (Z_TYPE_P(needle) == IS_UNICODE || Z_TYPE_P(needle) == IS_STRING) {
if (Z_TYPE_PP(str) != IS_ARRAY && Z_TYPE_PP(str) != IS_UNICODE &&
Z_TYPE_PP(str) != IS_STRING) {
- convert_to_text_ex(str);
+ convert_to_unicode_ex(str);
}
if (Z_TYPE_PP(repl) != IS_ARRAY && Z_TYPE_PP(repl) != IS_UNICODE &&
Z_TYPE_PP(repl) != IS_STRING) {
- convert_to_text_ex(repl);
+ convert_to_unicode_ex(repl);
}
if (Z_TYPE_PP(from) != IS_ARRAY) {
convert_to_long_ex(from);
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(repl), &pos_repl);
if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(repl), (void **) &tmp_repl, &pos_repl)) {
if (Z_TYPE_PP(repl) != IS_UNICODE && Z_TYPE_PP(repl) != IS_STRING) {
- convert_to_text_ex(tmp_repl);
+ convert_to_unicode_ex(tmp_repl);
}
} else {
tmp_repl = NULL;
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(str), &pos_str);
while (zend_hash_get_current_data_ex(Z_ARRVAL_PP(str), (void **) &tmp_str, &pos_str) == SUCCESS) {
if (Z_TYPE_PP(tmp_str) != IS_UNICODE && Z_TYPE_PP(tmp_str) != IS_STRING) {
- convert_to_text_ex(tmp_str);
+ convert_to_unicode_ex(tmp_str);
}
if (Z_TYPE_PP(from) == IS_ARRAY) {
if (Z_TYPE_PP(repl) == IS_ARRAY) {
if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(repl), (void **) &tmp_repl, &pos_repl)) {
if (Z_TYPE_PP(tmp_repl) != IS_UNICODE && Z_TYPE_PP(tmp_repl) != IS_STRING) {
- convert_to_text_ex(tmp_repl);
+ convert_to_unicode_ex(tmp_repl);
}
zend_hash_move_forward_ex(Z_ARRVAL_PP(repl), &pos_repl);
} else {
Converts a codepoint number to a character */
PHP_FUNCTION(chr)
{
+ UChar buf[2];
+ int buf_len;
long num;
char temp[2];
return;
}
- if (UG(unicode)) {
- UChar buf[2];
- int buf_len;
-
- if (num > UCHAR_MAX_VALUE) {
- php_error(E_WARNING, "Codepoint value cannot be greater than %X", UCHAR_MAX_VALUE);
- return;
- }
- buf_len = zend_codepoint_to_uchar((uint32_t) num, buf);
- RETURN_UNICODEL(buf, buf_len, 1);
- } else {
- temp[0] = (char) num;
- temp[1] = 0;
-
- RETVAL_STRINGL(temp, 1, 1);
+ if (num > UCHAR_MAX_VALUE) {
+ php_error(E_WARNING, "Codepoint value cannot be greater than %X", UCHAR_MAX_VALUE);
+ return;
}
+ buf_len = zend_codepoint_to_uchar((uint32_t) num, buf);
+ RETURN_UNICODEL(buf, buf_len, 1);
}
/* }}} */
int replace_len = 0;
/* Make sure we're dealing with strings. */
- convert_to_text_ex(subject);
- Z_TYPE_P(result) = ZEND_STR_TYPE;
+ convert_to_unicode_ex(subject);
+ Z_TYPE_P(result) = IS_UNICODE;
if (Z_UNILEN_PP(subject) == 0) {
ZVAL_EMPTY_TEXT(result);
return;
while (zend_hash_get_current_data(Z_ARRVAL_P(search), (void **) &search_entry) == SUCCESS) {
/* Make sure we're dealing with strings. */
SEPARATE_ZVAL(search_entry);
- convert_to_text(*search_entry);
+ convert_to_unicode(*search_entry);
if (Z_UNILEN_PP(search_entry) == 0) {
zend_hash_move_forward(Z_ARRVAL_P(search));
if (Z_TYPE_P(replace) == IS_ARRAY) {
if (zend_hash_get_current_data(Z_ARRVAL_P(replace), (void **)&replace_entry) == SUCCESS) {
/* Make sure we're dealing with strings. */
SEPARATE_ZVAL(replace_entry);
- convert_to_text(*replace_entry);
+ convert_to_unicode(*replace_entry);
/* Set replacement value to the one we got from array */
replace_value = Z_UNIVAL_PP(replace_entry);
}
if (Z_UNILEN_PP(search_entry) == 1) {
- if (UG(unicode)) {
- if (case_sensitivity) {
- php_u_char_to_str_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
- Z_USTRVAL_PP(search_entry)[0],
- replace_value.u, replace_len,
- &temp_result, replace_count);
- } else {
- Z_USTRVAL(temp_result) = php_u_str_to_str_case_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
- Z_USTRVAL_PP(search_entry), Z_USTRLEN_PP(search_entry),
- replace_value.u, replace_len,
- &Z_USTRLEN(temp_result), replace_count TSRMLS_CC);
- }
+ if (case_sensitivity) {
+ php_u_char_to_str_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
+ Z_USTRVAL_PP(search_entry)[0],
+ replace_value.u, replace_len,
+ &temp_result, replace_count);
} else {
- php_char_to_str_ex(Z_STRVAL_P(result), Z_STRLEN_P(result),
- Z_STRVAL_PP(search_entry)[0],
- replace_value.s, replace_len,
- &temp_result, case_sensitivity, replace_count);
+ Z_USTRVAL(temp_result) = php_u_str_to_str_case_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
+ Z_USTRVAL_PP(search_entry), Z_USTRLEN_PP(search_entry),
+ replace_value.u, replace_len,
+ &Z_USTRLEN(temp_result), replace_count TSRMLS_CC);
}
} else if (Z_UNILEN_PP(search_entry) > 1) {
- if (UG(unicode)) {
- if (case_sensitivity) {
- Z_USTRVAL(temp_result) = php_u_str_to_str_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
- Z_USTRVAL_PP(search_entry), Z_USTRLEN_PP(search_entry),
- replace_value.u, replace_len,
- &Z_USTRLEN(temp_result), replace_count);
- } else {
- Z_USTRVAL(temp_result) = php_u_str_to_str_case_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
- Z_USTRVAL_PP(search_entry), Z_USTRLEN_PP(search_entry),
- replace_value.u, replace_len,
- &Z_USTRLEN(temp_result), replace_count TSRMLS_CC);
- }
+ if (case_sensitivity) {
+ Z_USTRVAL(temp_result) = php_u_str_to_str_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
+ Z_USTRVAL_PP(search_entry), Z_USTRLEN_PP(search_entry),
+ replace_value.u, replace_len,
+ &Z_USTRLEN(temp_result), replace_count);
} else {
- Z_STRVAL(temp_result) = php_str_to_str_ex(Z_STRVAL_P(result), Z_STRLEN_P(result),
- Z_STRVAL_PP(search_entry), Z_STRLEN_PP(search_entry),
- replace_value.s, replace_len,
- &Z_STRLEN(temp_result), case_sensitivity, replace_count);
+ Z_USTRVAL(temp_result) = php_u_str_to_str_case_ex(Z_USTRVAL_P(result), Z_USTRLEN_P(result),
+ Z_USTRVAL_PP(search_entry), Z_USTRLEN_PP(search_entry),
+ replace_value.u, replace_len,
+ &Z_USTRLEN(temp_result), replace_count TSRMLS_CC);
}
}
}
} else {
if (Z_UNILEN_P(search) == 1) {
- if (UG(unicode)) {
- if (case_sensitivity) {
- php_u_char_to_str_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
- Z_USTRVAL_P(search)[0],
- Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
- result, replace_count);
- } else {
- Z_USTRVAL_P(result) = php_u_str_to_str_case_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
- Z_USTRVAL_P(search), Z_USTRLEN_P(search),
- Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
- &Z_USTRLEN_P(result), replace_count TSRMLS_CC);
- }
+ if (case_sensitivity) {
+ php_u_char_to_str_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
+ Z_USTRVAL_P(search)[0],
+ Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
+ result, replace_count);
} else {
- php_char_to_str_ex(Z_STRVAL_PP(subject), Z_STRLEN_PP(subject),
- Z_STRVAL_P(search)[0],
- Z_STRVAL_P(replace), Z_STRLEN_P(replace),
- result, case_sensitivity, replace_count);
+ Z_USTRVAL_P(result) = php_u_str_to_str_case_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
+ Z_USTRVAL_P(search), Z_USTRLEN_P(search),
+ Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
+ &Z_USTRLEN_P(result), replace_count TSRMLS_CC);
}
} else if (Z_STRLEN_P(search) > 1) {
- if (UG(unicode)) {
- if (case_sensitivity) {
- Z_USTRVAL_P(result) = php_u_str_to_str_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
- Z_USTRVAL_P(search), Z_USTRLEN_P(search),
- Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
- &Z_USTRLEN_P(result), replace_count);
- } else {
- Z_USTRVAL_P(result) = php_u_str_to_str_case_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
- Z_USTRVAL_P(search), Z_USTRLEN_P(search),
- Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
- &Z_USTRLEN_P(result), replace_count TSRMLS_CC);
- }
+ if (case_sensitivity) {
+ Z_USTRVAL_P(result) = php_u_str_to_str_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
+ Z_USTRVAL_P(search), Z_USTRLEN_P(search),
+ Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
+ &Z_USTRLEN_P(result), replace_count);
} else {
- Z_STRVAL_P(result) = php_str_to_str_ex(Z_STRVAL_PP(subject), Z_STRLEN_PP(subject),
- Z_STRVAL_P(search), Z_STRLEN_P(search),
- Z_STRVAL_P(replace), Z_STRLEN_P(replace),
- &Z_STRLEN_P(result), case_sensitivity, replace_count);
+ Z_USTRVAL_P(result) = php_u_str_to_str_case_ex(Z_USTRVAL_PP(subject), Z_USTRLEN_PP(subject),
+ Z_USTRVAL_P(search), Z_USTRLEN_P(search),
+ Z_USTRVAL_P(replace), Z_USTRLEN_P(replace),
+ &Z_USTRLEN_P(result), replace_count TSRMLS_CC);
}
} else {
*result = **subject;
/* Make sure we're dealing with strings and do the replacement. */
if (Z_TYPE_P(search) != IS_ARRAY) {
- convert_to_text(search);
- convert_to_text(replace);
+ convert_to_unicode(search);
+ convert_to_unicode(replace);
} else if (Z_TYPE_P(replace) != IS_ARRAY) {
- convert_to_text(replace);
+ convert_to_unicode(replace);
}
/* if subject is an array */
return;
}
- if (UG(unicode)) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "deprecated in Unicode mode, please use ICU locale functions");
- }
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "deprecated in Unicode mode, please use ICU locale functions");
#ifdef HAVE_SETLOCALE
if (Z_TYPE_PP(pcategory) == IS_LONG) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown mode");
RETURN_FALSE;
}
- if (UG(unicode) && mode != 1) {
+ if (mode != 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only mode=1 is supported with Unicode strings");
RETURN_FALSE;
}
return;
}
- if (UG(unicode)) {
- php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "deprecated in Unicode mode, please use ICU locale functions");
- }
+ php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "deprecated in Unicode mode, please use ICU locale functions");
MAKE_STD_ZVAL(grouping);
MAKE_STD_ZVAL(mon_grouping);
} else if (!strcasecmp(new_type, "binary")) { /* explicit binary cast */
convert_to_string(*var);
} else if (!strcasecmp(new_type, "string")) { /* runtime string type */
- if (UG(unicode)) {
- convert_to_unicode(*var);
- } else {
- convert_to_string(*var);
- }
+ convert_to_unicode(*var);
} else if (!strcasecmp(new_type, "unicode")) { /* explicit unicode cast */
convert_to_unicode(*var);
} else if (!strcasecmp(new_type, "array")) {
return;
}
- if (UG(unicode)) {
- zend_make_unicode_zval(*num, &expr_copy, &use_copy);
- } else {
- zend_make_string_zval(*num, &expr_copy, &use_copy);
- }
+ zend_make_unicode_zval(*num, &expr_copy, &use_copy);
if (use_copy) {
tmp = &expr_copy;
RETVAL_ZVAL(tmp, 0, 0);
if (ce->name_length != sizeof(INCOMPLETE_CLASS) - 1) {
/* We can get away with this because INCOMPLETE_CLASS is ascii and has a 1:1 relationship with unicode */
RETURN_TRUE;
- } else if (UG(unicode)) {
+ } else {
#ifndef PHP_WIN32
U_STRING_DECL(uIncompleteClass, (INCOMPLETE_CLASS), sizeof(INCOMPLETE_CLASS) - 1);
U_STRING_INIT(uIncompleteClass, (INCOMPLETE_CLASS), sizeof(INCOMPLETE_CLASS) - 1);
}
/* Non-ascii class name means it can't be INCOMPLETE_CLASS and is therefore okay */
#endif
- } else {
- if (!memcmp(ce->name.s, INCOMPLETE_CLASS, sizeof(INCOMPLETE_CLASS))) {
- RETURN_FALSE;
- }
}
}
if (type == IS_RESOURCE) {
{
zstr prefix = EMPTY_ZSTR;
int prefix_len = 0;
- zend_uchar str_type = ZEND_STR_TYPE;
+ zend_uchar str_type = IS_UNICODE;
#if defined(__CYGWIN__)
zend_bool more_entropy = 1;
#else
smart_str_appendl(buf, "O:", 2);
smart_str_append_long(buf, name_len);
smart_str_appendl(buf, ":\"", 2);
- if (UG(unicode)) {
- php_var_serialize_ustr(buf, class_name.u, name_len);
- } else {
- smart_str_appendl(buf, class_name.s, name_len);
- }
+ php_var_serialize_ustr(buf, class_name.u, name_len);
smart_str_appendl(buf, "\":", 2);
PHP_CLEANUP_CLASS_ATTRIBUTES();
return incomplete_class;
}
zend_hash_get_current_data_ex(HASH_OF(retval_ptr), (void **) &name, &pos);
- if (Z_TYPE_PP(name) != (UG(unicode) ? IS_UNICODE : IS_STRING)) {
+ if (Z_TYPE_PP(name) != IS_UNICODE) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "__sleep should return an array only containing the names of instance-variables to serialize");
/* we should still add element even if it's not OK,
* since we already wrote the length of the array before */
smart_str_appendl(buf, "C:", 2);
smart_str_append_long(buf, Z_OBJCE_P(struc)->name_length);
smart_str_appendl(buf, ":\"", 2);
-
- if (UG(unicode)) {
- php_var_serialize_ustr(buf, Z_OBJCE_P(struc)->name.u, Z_OBJCE_P(struc)->name_length);
- } else {
- smart_str_appendl(buf, Z_OBJCE_P(struc)->name.s, Z_OBJCE_P(struc)->name_length);
- }
-
+ php_var_serialize_ustr(buf, Z_OBJCE_P(struc)->name.u, Z_OBJCE_P(struc)->name_length);
smart_str_appendl(buf, "\":", 2);
smart_str_append_long(buf, serialized_length);
if (buf.c) {
RETVAL_ASCII_STRINGL(buf.c, buf.len, 0);
- if (UG(unicode)) {
- smart_str_free(&buf);
- }
+ smart_str_free(&buf);
} else {
RETURN_NULL();
}
-/* Generated by re2c 0.13.5 on Tue Mar 17 16:18:00 2009 */
+/* Generated by re2c 0.13.5 on Thu Mar 26 15:18:13 2009 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy103;
yy3:
-#line 817 "ext/standard/var_unserializer.re"
+#line 807 "ext/standard/var_unserializer.re"
{ return 0; }
#line 528 "ext/standard/var_unserializer.c"
yy4:
goto yy3;
yy15:
++YYCURSOR;
-#line 811 "ext/standard/var_unserializer.re"
+#line 801 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0;
}
- if (UG(unicode)) {
- class_name.u = unserialize_ustr(&YYCURSOR, len);
- } else {
- len3 = strspn((char*)YYCURSOR, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:");
- if (len3 != len) {
- *p = YYCURSOR + len3 - len;
- return 0;
- }
- class_name.s = estrndup((char*)YYCURSOR, len);
- YYCURSOR += len;
- }
+ class_name.u = unserialize_ustr(&YYCURSOR, len);
if (*(YYCURSOR) != '"') {
efree(class_name.v);
do {
/* Try to find class directly */
- if (zend_u_lookup_class(UG(unicode)?IS_UNICODE:IS_STRING, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_u_lookup_class(IS_UNICODE, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
break;
}
}
/* The callback function may have defined the class */
- if (zend_u_lookup_class(UG(unicode)?IS_UNICODE:IS_STRING, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_u_lookup_class(IS_UNICODE, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", user_func->value.str.val);
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 729 "ext/standard/var_unserializer.c"
+#line 719 "ext/standard/var_unserializer.c"
yy26:
yych = *++YYCURSOR;
if (yych <= ',') {
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 762 "ext/standard/var_unserializer.c"
+#line 752 "ext/standard/var_unserializer.c"
yy33:
yych = *++YYCURSOR;
if (yych == '+') goto yy34;
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 803 "ext/standard/var_unserializer.c"
+#line 793 "ext/standard/var_unserializer.c"
yy40:
yych = *++YYCURSOR;
if (yych == '+') goto yy41;
ZVAL_UNICODEL(*rval, ustr, len, 0);
return 1;
}
-#line 853 "ext/standard/var_unserializer.c"
+#line 843 "ext/standard/var_unserializer.c"
yy47:
yych = *++YYCURSOR;
if (yych == '+') goto yy48;
ZVAL_STRINGL(*rval, str, len, 0);
return 1;
}
-#line 903 "ext/standard/var_unserializer.c"
+#line 893 "ext/standard/var_unserializer.c"
yy54:
yych = *++YYCURSOR;
if (yych == '+') goto yy55;
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
}
-#line 952 "ext/standard/var_unserializer.c"
+#line 942 "ext/standard/var_unserializer.c"
yy61:
yych = *++YYCURSOR;
if (yych <= '/') {
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 1050 "ext/standard/var_unserializer.c"
+#line 1040 "ext/standard/var_unserializer.c"
yy73:
yych = *++YYCURSOR;
if (yych <= ',') {
return 1;
}
-#line 1124 "ext/standard/var_unserializer.c"
+#line 1114 "ext/standard/var_unserializer.c"
yy84:
yych = *++YYCURSOR;
if (yych == 'N') goto yy81;
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
}
-#line 1178 "ext/standard/var_unserializer.c"
+#line 1168 "ext/standard/var_unserializer.c"
yy91:
yych = *++YYCURSOR;
if (yych <= '/') goto yy19;
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
}
-#line 1193 "ext/standard/var_unserializer.c"
+#line 1183 "ext/standard/var_unserializer.c"
yy95:
++YYCURSOR;
#line 513 "ext/standard/var_unserializer.re"
ZVAL_NULL(*rval);
return 1;
}
-#line 1203 "ext/standard/var_unserializer.c"
+#line 1193 "ext/standard/var_unserializer.c"
yy97:
yych = *++YYCURSOR;
if (yych <= ',') {
return 1;
}
-#line 1249 "ext/standard/var_unserializer.c"
+#line 1239 "ext/standard/var_unserializer.c"
yy103:
yych = *++YYCURSOR;
if (yych <= ',') {
return 1;
}
-#line 1293 "ext/standard/var_unserializer.c"
+#line 1283 "ext/standard/var_unserializer.c"
}
-#line 819 "ext/standard/var_unserializer.re"
+#line 809 "ext/standard/var_unserializer.re"
return 0;
return 0;
}
- if (UG(unicode)) {
- class_name.u = unserialize_ustr(&YYCURSOR, len);
- } else {
- len3 = strspn((char*)YYCURSOR, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377:");
- if (len3 != len) {
- *p = YYCURSOR + len3 - len;
- return 0;
- }
- class_name.s = estrndup((char*)YYCURSOR, len);
- YYCURSOR += len;
- }
+ class_name.u = unserialize_ustr(&YYCURSOR, len);
if (*(YYCURSOR) != '"') {
efree(class_name.v);
do {
/* Try to find class directly */
- if (zend_u_lookup_class(UG(unicode)?IS_UNICODE:IS_STRING, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_u_lookup_class(IS_UNICODE, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
break;
}
}
/* The callback function may have defined the class */
- if (zend_u_lookup_class(UG(unicode)?IS_UNICODE:IS_STRING, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
+ if (zend_u_lookup_class(IS_UNICODE, class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
ce = *pce;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", user_func->value.str.val);
if (output.size) {
MAKE_STD_ZVAL(temp);
- if (UG(unicode)) {
- ZVAL_U_STRINGL(obj->converter->conv, temp, (char *) output.bp, output.size-1, 1);
- } else {
- ZVAL_STRINGL(temp, (char *) output.bp, output.size-1, 1);
- }
+ ZVAL_U_STRINGL(obj->converter->conv, temp, (char *) output.bp, output.size-1, 1);
zend_ascii_hash_update(obj->std.properties, "value", sizeof("value"), (void *)&temp, sizeof(zval *), NULL);
}
}
}
- if (UG(unicode)) {
- obj->converter = emalloc(sizeof(PHPTidyConv));
- obj->converter->conv = ucnv_open(tidyOptGetEncName(obj->ptdoc->doc, TidyOutCharEncoding), &Uerror);
- obj->converter->ref_count = 1;
- }
+ obj->converter = emalloc(sizeof(PHPTidyConv));
+ obj->converter->conv = ucnv_open(tidyOptGetEncName(obj->ptdoc->doc, TidyOutCharEncoding), &Uerror);
+ obj->converter->ref_count = 1;
tidyBufInit(&buf);
tidyBufAttach(&buf, (byte *) string, len);
zend_bool destroy;
int token_line = 1;
- CG(literal_type) = UG(unicode)?IS_UNICODE:IS_STRING;
+ CG(literal_type) = IS_UNICODE;
array_init(return_value);
len = _xml_xmlcharlen(s);
}
- if (UG(unicode)) {
- ZVAL_UTF8_STRINGL(ret, (char *)s, len, ZSTR_DUPLICATE);
- } else {
- Z_TYPE_P(ret) = IS_STRING;
- Z_STRVAL_P(ret) = xml_utf8_decode(s, len, &Z_STRLEN_P(ret), encoding);
- }
+ ZVAL_UTF8_STRINGL(ret, (char *)s, len, ZSTR_DUPLICATE);
return ret;
}
/* IS_ARRAY might indicate that we're using array($obj, 'method') syntax */
if (Z_TYPE_PP(data) != IS_ARRAY && Z_TYPE_PP(data) != IS_OBJECT) {
- convert_to_text_ex(data);
+ convert_to_unicode_ex(data);
if (((Z_TYPE_PP(data)==IS_UNICODE) && (Z_USTRLEN_PP(data) == 0)) ||
((Z_TYPE_PP(data)==IS_STRING) && (Z_STRLEN_PP(data) == 0))) {
TSRMLS_FETCH();
- if (UG(unicode)) {
- newstr = xml_utf8_decode(tag, strlen(tag), &out_len, NULL);
- } else {
- newstr = xml_utf8_decode(tag, strlen(tag), &out_len, parser->target_encoding);
- }
+ newstr = xml_utf8_decode(tag, strlen(tag), &out_len, NULL);
if (parser->case_folding) {
php_strtoupper(newstr, out_len);
while (attributes && *attributes) {
att = _xml_decode_tag(parser, attributes[0]);
- if (UG(unicode)) {
- val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, NULL);
- } else {
- val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding);
- }
+ val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, NULL);
add_utf8_assoc_utf8_stringl(args[2], att, val, val_len, ZSTR_AUTOFREE);
while (attributes && *attributes) {
att = _xml_decode_tag(parser, attributes[0]);
- if (UG(unicode)) {
- val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, NULL);
- } else {
- val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, parser->target_encoding);
- }
+ val = xml_utf8_decode(attributes[1], strlen(attributes[1]), &val_len, NULL);
add_utf8_assoc_utf8_stringl(atr, att, val, val_len, ZSTR_AUTOFREE);
TSRMLS_FETCH();
- if (UG(unicode)) {
- decoded_value = xml_utf8_decode(s,len,&decoded_len,NULL);
- } else {
- decoded_value = xml_utf8_decode(s,len,&decoded_len,parser->target_encoding);
- }
+ decoded_value = xml_utf8_decode(s,len,&decoded_len,NULL);
for (i = 0; i < decoded_len; i++) {
switch (decoded_value[i]) {
case ' ':
if (data_type == IS_UNICODE) {
RETURN_UNICODEL(data, data_len, 1);
}
- if (UG(unicode)) {
- decoded = xml_utf8_decode(data, data_len, &len, NULL);
- } else {
- decoded = xml_utf8_decode(data, data_len, &len, "ISO-8859-1");
- }
+ decoded = xml_utf8_decode(data, data_len, &len, NULL);
if (decoded == NULL) {
RETURN_FALSE;
if (member->type != IS_STRING && member->type != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
if (member->type != IS_STRING && member->type != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
if (member->type != IS_STRING && member->type != IS_UNICODE) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
- convert_to_text(&tmp_member);
+ convert_to_unicode(&tmp_member);
member = &tmp_member;
}
/* {{{ sapi_update_default_charset */
SAPI_API void sapi_update_default_charset(TSRMLS_D)
{
- if (UG(unicode)) {
- const char *canonical_name = NULL;
- UErrorCode status = U_ZERO_ERROR;
-
- canonical_name = ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status);
- /*
- * UTODO handle NULL return which signifies that MIME standard has no
- * name for this converter
- */
- SG(default_charset) = (char *)ucnv_getStandardName(canonical_name, "MIME", &status);
- } else {
- SG(default_charset) = zend_ini_string("default_charset", sizeof("default_charset"), 0);
- }
+ const char *canonical_name = NULL;
+ UErrorCode status = U_ZERO_ERROR;
+
+ canonical_name = ucnv_getName(ZEND_U_CONVERTER(UG(output_encoding_conv)), &status);
+ /*
+ * UTODO handle NULL return which signifies that MIME standard has no
+ * name for this converter
+ */
+ SG(default_charset) = (char *)ucnv_getStandardName(canonical_name, "MIME", &status);
}
/* }}} */
while (s < e && (p = memchr(s, '&', (e - s)))) {
last_value:
if ((val = memchr(s, '=', (p - s)))) { /* have a value */
- if (UG(unicode)) {
- UChar *u_var, *u_val;
- int u_var_len, u_val_len;
- int var_len;
- int val_len;
- UErrorCode status1 = U_ZERO_ERROR, status2 = U_ZERO_ERROR;
-
- var = s;
- var_len = val - s;
-
- php_url_decode(var, var_len);
- val++;
- val_len = php_url_decode(val, (p - val));
- zend_string_to_unicode_ex(input_conv, &u_var, &u_var_len, var, var_len, &status1);
- zend_string_to_unicode_ex(input_conv, &u_val, &u_val_len, val, val_len, &status2);
- if (U_SUCCESS(status1) && U_SUCCESS(status2)) {
- /* UTODO add input filtering */
- php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC);
- } else {
- /* UTODO set a user-accessible flag to indicate that conversion failed? */
- }
- efree(u_var);
- efree(u_val);
+ UChar *u_var, *u_val;
+ int u_var_len, u_val_len;
+ int var_len;
+ int val_len;
+ UErrorCode status1 = U_ZERO_ERROR, status2 = U_ZERO_ERROR;
+
+ var = s;
+ var_len = val - s;
+
+ php_url_decode(var, var_len);
+ val++;
+ val_len = php_url_decode(val, (p - val));
+ zend_string_to_unicode_ex(input_conv, &u_var, &u_var_len, var, var_len, &status1);
+ zend_string_to_unicode_ex(input_conv, &u_val, &u_val_len, val, val_len, &status2);
+ if (U_SUCCESS(status1) && U_SUCCESS(status2)) {
+ /* UTODO add input filtering */
+ php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC);
} else {
- unsigned int val_len, new_val_len;
-
- var = s;
-
- php_url_decode(var, (val - s));
- val++;
- val_len = php_url_decode(val, (p - val));
- val = estrndup(val, val_len);
- if (sapi_module.input_filter(PARSE_POST, var, &val, val_len, &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
- }
- efree(val);
+ /* UTODO set a user-accessible flag to indicate that conversion failed? */
}
+ efree(u_var);
+ efree(u_val);
}
s = p + 1;
}
var_len = strlen(var);
php_url_decode(var, var_len);
- if (UG(unicode)) {
- UChar *u_var, *u_val;
- int u_var_len, u_val_len;
- UErrorCode status = U_ZERO_ERROR;
+ UChar *u_var, *u_val;
+ int u_var_len, u_val_len;
+ UErrorCode status = U_ZERO_ERROR;
+
+ zend_string_to_unicode_ex(input_conv, &u_var, &u_var_len, var, var_len, &status);
+ if (U_FAILURE(status)) {
+ /* UTODO set a user-accessible flag to indicate that conversion failed? */
+ efree(u_var);
+ goto next_var;
+ }
- zend_string_to_unicode_ex(input_conv, &u_var, &u_var_len, var, var_len, &status);
+ if (val) { /* have a value */
+ int val_len;
+ /* unsigned int new_val_len; see below */
+
+ val_len = php_url_decode(val, strlen(val));
+ zend_string_to_unicode_ex(input_conv, &u_val, &u_val_len, val, val_len, &status);
if (U_FAILURE(status)) {
/* UTODO set a user-accessible flag to indicate that conversion failed? */
efree(u_var);
+ efree(u_val);
goto next_var;
}
-
- if (val) { /* have a value */
- int val_len;
- /* unsigned int new_val_len; see below */
-
- val_len = php_url_decode(val, strlen(val));
- zend_string_to_unicode_ex(input_conv, &u_val, &u_val_len, val, val_len, &status);
- if (U_FAILURE(status)) {
- /* UTODO set a user-accessible flag to indicate that conversion failed? */
- efree(u_var);
- efree(u_val);
- goto next_var;
- }
- php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC);
- /* UTODO need to make input_filter Unicode aware */
- /*
- if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
- }
- */
- efree(u_var);
- efree(u_val);
- } else {
- u_val_len = 0;
- u_val = USTR_MAKE("");
- php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC);
- /*
- if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) {
- php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
- }
- */
- efree(u_var);
- efree(u_val);
+ php_u_register_variable_safe(u_var, u_val, u_val_len, array_ptr TSRMLS_CC);
+ /* UTODO need to make input_filter Unicode aware */
+ /*
+ if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) {
+ php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
}
+ */
+ efree(u_var);
+ efree(u_val);
} else {
if (val) { /* have a value */
int val_len;
SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
{
- if (UG(unicode)) {
- rfc1867_post_handler_unicode(content_type_dup, arg TSRMLS_CC);
- } else {
- rfc1867_post_handler_legacy(content_type_dup, arg TSRMLS_CC);
- }
+ rfc1867_post_handler_unicode(content_type_dup, arg TSRMLS_CC);
}
/*
break;
case 'v':
- if (UG(unicode)) {
- goto fmt_unicode;
- } else {
- goto fmt_string;
- }
+ goto fmt_unicode;
break;
case 'R':
PHPAPI void php_stream_fix_encoding(php_stream *stream, const char *mode, php_stream_context *context TSRMLS_DC)
{
/* Output encoding on text mode streams defaults to utf8 unless specified in context parameter */
- if (stream && strchr(mode, 't') && UG(unicode)) {
+ if (stream && strchr(mode, 't')) {
/* Only apply implicit unicode.to. filter if the wrapper didn't do it for us */
if ((php_stream_filter_product(&stream->writefilters, IS_UNICODE) == IS_UNICODE) &&
(strchr(mode, 'w') || strchr(mode, 'a') || strchr(mode, '+'))) {