mirror of
https://github.com/php/php-src.git
synced 2026-03-27 17:52:16 +01:00
Unicode support cleanup
This commit is contained in:
@@ -618,11 +618,7 @@ static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec, char T_ar
|
||||
if (return_null) {
|
||||
*p = NULL;
|
||||
*pl = 0;
|
||||
if (UG(unicode)) {
|
||||
*type = IS_UNICODE;
|
||||
} else {
|
||||
*type = IS_STRING;
|
||||
}
|
||||
*type = UG(unicode)?IS_UNICODE:IS_STRING;
|
||||
break;
|
||||
}
|
||||
/* break omitted intentionally */
|
||||
|
||||
195
Zend/zend_API.h
195
Zend/zend_API.h
@@ -275,6 +275,37 @@ ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, void *str,
|
||||
ZEND_API int add_assoc_unicodel_ex(zval *arg, char *key, uint key_len, void *str, uint length, int duplicate);
|
||||
ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
|
||||
|
||||
#define add_assoc_text_ex(arg, key, key_len, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_assoc_unicode_ex(arg, key, key_len, (UChar*)(str), duplicate); \
|
||||
} else { \
|
||||
add_assoc_string_ex(arg, key, key_len, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_assoc_textl_ex(arg, key, key_len, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_assoc_unicodel_ex(arg, key, key_len, (UChar*)(str), length, duplicate); \
|
||||
} else { \
|
||||
add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
#define add_assoc_ascii_string_ex(arg, key, key_len, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
uint length = strlen(str); \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \
|
||||
add_assoc_unicodel_ex(arg, key, key_len, u_str, length, 0); \
|
||||
} else { \
|
||||
add_assoc_string_ex(arg, key, key_len, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_assoc_ascii_stringl_ex(arg, key, key_len, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \
|
||||
add_assoc_unicodel_ex(arg, key, key_len, u_str, length, 0); \
|
||||
} else { \
|
||||
add_assoc_stringl_ex(arg, key, key_len, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
|
||||
#define add_assoc_null(__arg, __key) add_assoc_null_ex(__arg, __key, strlen(__key) + 1)
|
||||
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
|
||||
@@ -286,6 +317,37 @@ ZEND_API int add_assoc_zval_ex(zval *arg, char *key, uint key_len, zval *value);
|
||||
#define add_assoc_unicodel(__arg, __key, __str, __length, __duplicate) add_assoc_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate)
|
||||
#define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key)+1, __value)
|
||||
|
||||
#define add_assoc_text(arg, key, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_assoc_unicode(arg, key, (UChar*)(str), duplicate); \
|
||||
} else { \
|
||||
add_assoc_string(arg, key, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_assoc_textl(arg, key, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_assoc_unicodel(arg, key, (UChar*)(str), length, duplicate); \
|
||||
} else { \
|
||||
add_assoc_stringl(arg, key, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
#define add_assoc_ascii_string(arg, key, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
uint length = strlen(str); \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \
|
||||
add_assoc_unicodel(arg, key, u_str, length, 0); \
|
||||
} else { \
|
||||
add_assoc_string(arg, key, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_assoc_ascii_stringl(arg, key, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), (length)+1 ZEND_FILE_LINE_CC); \
|
||||
add_assoc_unicodel(arg, key, u_str, length, 0); \
|
||||
} else { \
|
||||
add_assoc_stringl(arg, key, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
ZEND_API int add_u_assoc_zval_ex(zval *arg, zend_uchar type, void *key, uint key_len, zval *value);
|
||||
|
||||
#define add_u_assoc_zval(__arg, __type, __key, __value) add_u_assoc_zval_ex(__arg, __type, __key, (((__type)==IS_UNICODE)?u_strlen((UChar*)__key):strlen(__key))+1, __value)
|
||||
@@ -309,6 +371,37 @@ ZEND_API int add_index_unicode(zval *arg, uint idx, UChar *str, int duplicate);
|
||||
ZEND_API int add_index_unicodel(zval *arg, uint idx, UChar *str, uint length, int duplicate);
|
||||
ZEND_API int add_index_zval(zval *arg, uint index, zval *value);
|
||||
|
||||
#define add_index_text(arg, idx, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_index_unicode(arg, idx, (UChar*)(str), duplicate); \
|
||||
} else { \
|
||||
add_index_string(arg, idx, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_index_textl(arg, idx, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_index_unicodel(arg, idx, (UChar*)(str), length, duplicate); \
|
||||
} else { \
|
||||
add_index_stringl(arg, idx, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
#define add_index_ascii_string(arg, idx, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
uint length = strlen(str); \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \
|
||||
add_index_unicodel(arg, idx, u_str, length, 0); \
|
||||
} else { \
|
||||
add_index_string(arg, idx, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_index_ascii_stringl(arg, idx, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \
|
||||
add_index_unicodel(arg, idx, u_str, length, 0); \
|
||||
} else { \
|
||||
add_index_stringl(arg, idx, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
ZEND_API int add_next_index_long(zval *arg, long n);
|
||||
ZEND_API int add_next_index_null(zval *arg);
|
||||
ZEND_API int add_next_index_bool(zval *arg, int b);
|
||||
@@ -322,6 +415,37 @@ ZEND_API int add_next_index_unicode(zval *arg, UChar *str, int duplicate);
|
||||
ZEND_API int add_next_index_unicodel(zval *arg, UChar *str, uint length, int duplicate);
|
||||
ZEND_API int add_next_index_zval(zval *arg, zval *value);
|
||||
|
||||
#define add_next_index_text(arg, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_next_index_unicode(arg, (UChar*)(str), duplicate); \
|
||||
} else { \
|
||||
add_next_index_string(arg, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_next_index_textl(arg, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
add_next_index_unicodel(arg, (UChar*)(str), length, duplicate); \
|
||||
} else { \
|
||||
add_next_index_stringl(arg, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
#define add_next_index_ascii_string(arg, str, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
uint length = strlen(str); \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \
|
||||
add_next_index_unicodel(arg, u_str, length, 0); \
|
||||
} else { \
|
||||
add_next_index_string(arg, (char*)(str), duplicate); \
|
||||
}
|
||||
|
||||
#define add_next_index_ascii_stringl(arg, str, length, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
UChar *u_str = zend_ascii_to_unicode((str), length+1 ZEND_FILE_LINE_CC); \
|
||||
add_next_index_unicodel(arg, u_str, length, 0); \
|
||||
} else { \
|
||||
add_next_index_stringl(arg, (char*)(str), length, duplicate); \
|
||||
}
|
||||
|
||||
ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate);
|
||||
ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate);
|
||||
|
||||
@@ -457,6 +581,29 @@ END_EXTERN_C()
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
#define ZVAL_ASCII_STRING(z, s, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
uint length = strlen(s); \
|
||||
UChar *u_str = zend_ascii_to_unicode((s), length+1 ZEND_FILE_LINE_CC); \
|
||||
ZVAL_UNICODEL(z, u_str, length, 0); \
|
||||
} else { \
|
||||
char *__s=(s); \
|
||||
(z)->value.str.len = strlen(__s); \
|
||||
(z)->value.str.val = (duplicate?estrndup(__s, (z)->value.str.len):__s); \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
#define ZVAL_ASCII_STRINGL(z, s, l, duplicate) \
|
||||
if (UG(unicode)) { \
|
||||
UChar *u_str = zend_ascii_to_unicode((s), (l)+1 ZEND_FILE_LINE_CC); \
|
||||
ZVAL_UNICODEL(z, u_str, l, 0); \
|
||||
} else { \
|
||||
char *__s=(s); int __l=l; \
|
||||
(z)->value.str.len = __l; \
|
||||
(z)->value.str.val = (duplicate?estrndup(__s, __l):__s); \
|
||||
(z)->type = IS_STRING; \
|
||||
}
|
||||
|
||||
#define ZVAL_UNICODE(z, u, duplicate) { \
|
||||
UChar *__u=(u); \
|
||||
(z)->value.ustr.len = u_strlen(__u); \
|
||||
@@ -521,6 +668,31 @@ END_EXTERN_C()
|
||||
(z)->refcount = refcount; \
|
||||
}
|
||||
|
||||
#define ZVAL_TEXT(z, t, duplicate) \
|
||||
do { \
|
||||
if (UG(unicode)) { \
|
||||
ZVAL_UNICODE(z, t, duplicate); \
|
||||
} else { \
|
||||
ZVAL_STRING(z, t, duplicate); \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define ZVAL_TEXTL(z, t, l, duplicate) \
|
||||
do { \
|
||||
if (UG(unicode)) { \
|
||||
ZVAL_UNICODEL(z, t, l, duplicate); \
|
||||
} else { \
|
||||
ZVAL_STRINGL(z, t, l, duplicate); \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define ZVAL_EMPTY_TEXT(z) \
|
||||
if (UG(unicode)) { \
|
||||
ZVAL_EMPTY_UNICODE(z); \
|
||||
} else { \
|
||||
ZVAL_EMPTY_STRING(z); \
|
||||
}
|
||||
|
||||
#define ZVAL_FALSE(z) ZVAL_BOOL(z, 0)
|
||||
#define ZVAL_TRUE(z) ZVAL_BOOL(z, 1)
|
||||
|
||||
@@ -531,6 +703,8 @@ END_EXTERN_C()
|
||||
#define RETVAL_DOUBLE(d) ZVAL_DOUBLE(return_value, d)
|
||||
#define RETVAL_STRING(s, duplicate) ZVAL_STRING(return_value, s, duplicate)
|
||||
#define RETVAL_STRINGL(s, l, duplicate) ZVAL_STRINGL(return_value, s, l, duplicate)
|
||||
#define RETVAL_ASCII_STRING(s, duplicate) ZVAL_ASCII_STRING(return_value, s, duplicate)
|
||||
#define RETVAL_ASCII_STRINGL(s, l, duplicate) ZVAL_ASCII_STRINGL(return_value, s, l, duplicate)
|
||||
#define RETVAL_EMPTY_STRING() ZVAL_EMPTY_STRING(return_value)
|
||||
#define RETVAL_UNICODE(u, duplicate) ZVAL_UNICODE(return_value, u, duplicate)
|
||||
#define RETVAL_UNICODEL(u, l, duplicate) ZVAL_UNICODEL(return_value, u, l, duplicate)
|
||||
@@ -541,23 +715,8 @@ END_EXTERN_C()
|
||||
#define RETVAL_ZVAL(zv, copy, dtor) ZVAL_ZVAL(return_value, zv, copy, dtor)
|
||||
#define RETVAL_FALSE ZVAL_BOOL(return_value, 0)
|
||||
#define RETVAL_TRUE ZVAL_BOOL(return_value, 1)
|
||||
#define RETVAL_TEXT(t, duplicate) \
|
||||
do { \
|
||||
if (UG(unicode)) { \
|
||||
RETVAL_UNICODE(t, duplicate); \
|
||||
} else { \
|
||||
RETVAL_STRING(t, duplicate); \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
#define RETVAL_TEXTL(t, l, duplicate) \
|
||||
do { \
|
||||
if (UG(unicode)) { \
|
||||
RETVAL_UNICODEL(t, l, duplicate); \
|
||||
} else { \
|
||||
RETVAL_STRINGL(t, l, duplicate); \
|
||||
} \
|
||||
} while (0);
|
||||
#define RETVAL_TEXT(t, duplicate) ZVAL_TEXT(return_value, t, duplicate)
|
||||
#define RETVAL_TEXTL(t, l, duplicate) ZVAL_TEXTL(return_value, t, l, duplicate)
|
||||
|
||||
#define RETURN_RESOURCE(l) { RETVAL_RESOURCE(l); return; }
|
||||
#define RETURN_BOOL(b) { RETVAL_BOOL(b); return; }
|
||||
@@ -578,6 +737,8 @@ END_EXTERN_C()
|
||||
#define RETURN_TRUE { RETVAL_TRUE; return; }
|
||||
#define RETURN_TEXT(t, duplicate) { RETVAL_TEXT(t, duplicate); return; }
|
||||
#define RETURN_TEXTL(t, l, duplicate) { RETVAL_TEXTL(t, l, duplicate); return; }
|
||||
#define RETURN_ASCII_STRING(t, duplicate) { RETVAL_ASCII_STRING(t, duplicate); return; }
|
||||
#define RETURN_ASCII_STRINGL(t, l, duplicate) { RETVAL_ASCII_STRINGL(t, l, duplicate); return; }
|
||||
|
||||
#define SET_VAR_STRING(n, v) { \
|
||||
{ \
|
||||
|
||||
@@ -158,7 +158,7 @@ int zend_startup_builtin_functions(TSRMLS_D)
|
||||
Get the version of the Zend Engine */
|
||||
ZEND_FUNCTION(zend_version)
|
||||
{
|
||||
RETURN_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1, 1);
|
||||
RETURN_ASCII_STRINGL(ZEND_VERSION, sizeof(ZEND_VERSION)-1, 1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -292,13 +292,8 @@ ZEND_NAMED_FUNCTION(zend_if_strlen)
|
||||
break;
|
||||
|
||||
default:
|
||||
if (UG(unicode)) {
|
||||
convert_to_unicode_ex(str);
|
||||
RETVAL_LONG(Z_USTRLEN_PP(str));
|
||||
} else {
|
||||
convert_to_string_ex(str);
|
||||
RETVAL_LONG(Z_STRLEN_PP(str));
|
||||
}
|
||||
convert_to_text_ex(str);
|
||||
RETVAL_LONG(Z_UNILEN_PP(str));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -508,8 +503,8 @@ ZEND_FUNCTION(define)
|
||||
break;
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(var) != IS_STRING && Z_TYPE_PP(var) != IS_UNICODE) {
|
||||
convert_to_string_ex(var);
|
||||
if (Z_TYPE_PP(var) != (UG(unicode)?IS_UNICODE:IS_STRING)) {
|
||||
convert_to_text_ex(var);
|
||||
}
|
||||
|
||||
c.value = **val;
|
||||
@@ -564,11 +559,7 @@ ZEND_FUNCTION(get_class)
|
||||
|
||||
if (!ZEND_NUM_ARGS()) {
|
||||
if (EG(scope)) {
|
||||
if (UG(unicode)) {
|
||||
RETURN_UNICODEL((UChar*)EG(scope)->name, EG(scope)->name_length, 1);
|
||||
} else {
|
||||
RETURN_STRINGL(EG(scope)->name, EG(scope)->name_length, 1);
|
||||
}
|
||||
RETURN_TEXTL(EG(scope)->name, EG(scope)->name_length, 1);
|
||||
} else {
|
||||
zend_error(E_ERROR, "get_class() called without object from outside a class");
|
||||
}
|
||||
@@ -582,11 +573,7 @@ ZEND_FUNCTION(get_class)
|
||||
|
||||
dup = zend_get_object_classname(*arg, &name, &name_len TSRMLS_CC);
|
||||
|
||||
if (UG(unicode)) {
|
||||
RETURN_UNICODEL((UChar*)name, name_len, 0);
|
||||
} else {
|
||||
RETURN_STRINGL(name, name_len, 0);
|
||||
}
|
||||
RETURN_TEXTL(name, name_len, 0);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -603,11 +590,7 @@ ZEND_FUNCTION(get_parent_class)
|
||||
if (!ZEND_NUM_ARGS()) {
|
||||
ce = EG(scope);
|
||||
if (ce && ce->parent) {
|
||||
if (UG(unicode)) {
|
||||
RETURN_UNICODEL((UChar*)ce->parent->name, ce->parent->name_length, 1);
|
||||
} else {
|
||||
RETURN_STRINGL(ce->parent->name, ce->parent->name_length, 1);
|
||||
}
|
||||
RETURN_TEXTL(ce->parent->name, ce->parent->name_length, 1);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -619,15 +602,11 @@ ZEND_FUNCTION(get_parent_class)
|
||||
if (Z_TYPE_PP(arg) == IS_OBJECT) {
|
||||
if (Z_OBJ_HT_PP(arg)->get_class_name
|
||||
&& Z_OBJ_HT_PP(arg)->get_class_name(*arg, &name, &name_length, 1 TSRMLS_CC) == SUCCESS) {
|
||||
if (UG(unicode)) {
|
||||
RETURN_UNICODEL((UChar*)name, name_length, 0);
|
||||
} else{
|
||||
RETURN_STRINGL(name, name_length, 0);
|
||||
}
|
||||
RETURN_TEXTL(name, name_length, 0);
|
||||
} else {
|
||||
ce = zend_get_class_entry(*arg TSRMLS_CC);
|
||||
}
|
||||
} else if (Z_TYPE_PP(arg) == IS_STRING || Z_TYPE_PP(arg) == IS_UNICODE) {
|
||||
} else if (Z_TYPE_PP(arg) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
|
||||
zend_class_entry **pce;
|
||||
|
||||
if (zend_u_lookup_class(Z_TYPE_PP(arg), Z_UNIVAL_PP(arg), Z_UNILEN_PP(arg), &pce TSRMLS_CC) == SUCCESS) {
|
||||
@@ -636,11 +615,7 @@ ZEND_FUNCTION(get_parent_class)
|
||||
}
|
||||
|
||||
if (ce && ce->parent) {
|
||||
if (UG(unicode)) {
|
||||
RETURN_UNICODEL((UChar*)ce->parent->name, ce->parent->name_length, 1);
|
||||
} else {
|
||||
RETURN_STRINGL(ce->parent->name, ce->parent->name_length, 1);
|
||||
}
|
||||
RETURN_TEXTL(ce->parent->name, ce->parent->name_length, 1);
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -659,7 +634,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if (only_subclass && Z_TYPE_PP(obj) == IS_STRING) {
|
||||
if (only_subclass && Z_TYPE_PP(obj) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
|
||||
zend_class_entry **the_ce;
|
||||
if (zend_u_lookup_class(Z_TYPE_PP(obj), Z_UNIVAL_PP(obj), Z_UNILEN_PP(obj), &the_ce TSRMLS_CC) == FAILURE) {
|
||||
zend_error(E_WARNING, "Unknown class passed as parameter");
|
||||
@@ -677,7 +652,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
convert_to_string_ex(class_name);
|
||||
convert_to_text_ex(class_name);
|
||||
|
||||
if (zend_u_lookup_class(Z_TYPE_PP(class_name), Z_UNIVAL_PP(class_name), Z_UNILEN_PP(class_name), &ce TSRMLS_CC) == FAILURE) {
|
||||
retval = 0;
|
||||
@@ -873,7 +848,7 @@ ZEND_FUNCTION(get_class_methods)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ce = Z_OBJCE_PP(class);
|
||||
} else if (Z_TYPE_PP(class) == IS_STRING || Z_TYPE_PP(class) == IS_UNICODE) {
|
||||
} else if (Z_TYPE_PP(class) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
|
||||
if (zend_u_lookup_class(Z_TYPE_PP(class), Z_UNIVAL_PP(class), Z_UNILEN_PP(class), &pce TSRMLS_CC) == SUCCESS) {
|
||||
ce = *pce;
|
||||
}
|
||||
@@ -894,11 +869,7 @@ ZEND_FUNCTION(get_class_methods)
|
||||
|| ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
|
||||
EG(scope) == mptr->common.scope)))) {
|
||||
MAKE_STD_ZVAL(method_name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(method_name, (UChar*)mptr->common.function_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(method_name, mptr->common.function_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(method_name, mptr->common.function_name, 1);
|
||||
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);
|
||||
}
|
||||
zend_hash_move_forward_ex(&ce->function_table, &pos);
|
||||
@@ -921,7 +892,7 @@ ZEND_FUNCTION(method_exists)
|
||||
}
|
||||
if (Z_TYPE_PP(klass) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_PP(klass);
|
||||
} else if (Z_TYPE_PP(klass) == IS_STRING || Z_TYPE_PP(klass) == IS_UNICODE) {
|
||||
} else if (Z_TYPE_PP(klass) == (UG(unicode)?IS_UNICODE:IS_STRING)) {
|
||||
if (zend_u_lookup_class(Z_TYPE_PP(klass), Z_UNIVAL_PP(klass), Z_UNILEN_PP(klass), &pce TSRMLS_CC) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -972,7 +943,7 @@ ZEND_FUNCTION(property_exists)
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(property) != IS_UNICODE && (UG(unicode) || (Z_TYPE_PP(property) != IS_STRING))) {
|
||||
if (Z_TYPE_PP(property) != (UG(unicode)?IS_UNICODE:IS_STRING)) {
|
||||
convert_to_text_ex(property);
|
||||
}
|
||||
|
||||
@@ -1105,7 +1076,7 @@ ZEND_FUNCTION(function_exists)
|
||||
if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) {
|
||||
ZEND_WRONG_PARAM_COUNT();
|
||||
}
|
||||
convert_to_string_ex(function_name);
|
||||
convert_to_text_ex(function_name);
|
||||
lcname = zend_u_str_case_fold(Z_TYPE_PP(function_name), Z_UNIVAL_PP(function_name), Z_UNILEN_PP(function_name), 1, &lcname_len);
|
||||
|
||||
retval = (zend_u_hash_find(EG(function_table), Z_TYPE_PP(function_name), lcname, lcname_len+1, (void **)&func) == SUCCESS);
|
||||
@@ -1361,11 +1332,7 @@ static int copy_class_or_interface_name(zend_class_entry **pce, int num_args, va
|
||||
(hash_key->type == IS_UNICODE && hash_key->u.unicode[0] != 0) ||
|
||||
(hash_key->type == IS_STRING && hash_key->u.string[0] != 0))
|
||||
&& (comply_mask == (ce->ce_flags & mask))) {
|
||||
if (UG(unicode)) {
|
||||
add_next_index_unicodel(array, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
add_next_index_stringl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
add_next_index_textl(array, ce->name, ce->name_length, 1);
|
||||
}
|
||||
return ZEND_HASH_APPLY_KEEP;
|
||||
}
|
||||
@@ -1534,7 +1501,10 @@ ZEND_FUNCTION(create_function)
|
||||
function_name_length = strlen(function_name+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));
|
||||
RETURN_STRINGL(function_name, function_name_length, 0);
|
||||
RETVAL_ASCII_STRINGL(function_name, function_name_length, 0);
|
||||
if (UG(unicode)) {
|
||||
efree(function_name);
|
||||
}
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@@ -1577,9 +1547,9 @@ ZEND_FUNCTION(get_resource_type)
|
||||
|
||||
resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type) TSRMLS_CC);
|
||||
if (resource_type) {
|
||||
RETURN_STRING(resource_type, 1);
|
||||
RETURN_ASCII_STRING(resource_type, 1);
|
||||
} else {
|
||||
RETURN_STRING("Unknown", 1);
|
||||
RETURN_ASCII_STRING("Unknown", 1);
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -1588,7 +1558,7 @@ ZEND_FUNCTION(get_resource_type)
|
||||
static int add_extension_info(zend_module_entry *module, void *arg TSRMLS_DC)
|
||||
{
|
||||
zval *name_array = (zval *)arg;
|
||||
add_next_index_string(name_array, module->name, 1);
|
||||
add_next_index_ascii_string(name_array, module->name, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2002,38 +1972,22 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
function_name = ptr->function_state.function->common.function_name;
|
||||
|
||||
if (function_name) {
|
||||
if (UG(unicode)) {
|
||||
add_assoc_unicode_ex(stack_frame, "function", sizeof("function"), function_name, 1);
|
||||
} else {
|
||||
add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
|
||||
}
|
||||
add_assoc_text_ex(stack_frame, "function", sizeof("function"), function_name, 1);
|
||||
|
||||
if (ptr->object && Z_TYPE_P(ptr->object) == IS_OBJECT) {
|
||||
if (ptr->function_state.function->common.scope) {
|
||||
if (UG(unicode)) {
|
||||
add_assoc_unicode_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
|
||||
} else {
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
|
||||
}
|
||||
add_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1);
|
||||
} else {
|
||||
zend_uint class_name_len;
|
||||
int dup;
|
||||
|
||||
dup = zend_get_object_classname(ptr->object, &class_name, &class_name_len TSRMLS_CC);
|
||||
if (UG(unicode)) {
|
||||
add_assoc_unicode_ex(stack_frame, "class", sizeof("class"), class_name, dup);
|
||||
} else {
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), class_name, dup);
|
||||
}
|
||||
add_assoc_text_ex(stack_frame, "class", sizeof("class"), class_name, dup);
|
||||
}
|
||||
add_assoc_string_ex(stack_frame, "type", sizeof("type"), "->", 1);
|
||||
add_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "->", 1);
|
||||
} else if (ptr->function_state.function->common.scope) {
|
||||
if (UG(unicode)) {
|
||||
add_assoc_unicode_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
|
||||
} else {
|
||||
add_assoc_string_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, 1);
|
||||
}
|
||||
add_assoc_string_ex(stack_frame, "type", sizeof("type"), "::", 1);
|
||||
add_assoc_textl_ex(stack_frame, "class", sizeof("class"), ptr->function_state.function->common.scope->name, ptr->function_state.function->common.scope->name_length, 1);
|
||||
add_assoc_ascii_string_ex(stack_frame, "type", sizeof("type"), "::", 1);
|
||||
}
|
||||
|
||||
if ((! ptr->opline) || ((ptr->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (ptr->opline->opcode == ZEND_DO_FCALL))) {
|
||||
@@ -2090,7 +2044,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last TSRML
|
||||
add_assoc_zval_ex(stack_frame, "args", sizeof("args"), arg_array);
|
||||
}
|
||||
|
||||
add_assoc_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
|
||||
add_assoc_ascii_string_ex(stack_frame, "function", sizeof("function"), function_name, 1);
|
||||
}
|
||||
|
||||
add_next_index_zval(return_value, stack_frame);
|
||||
@@ -2170,7 +2124,7 @@ ZEND_FUNCTION(get_extension_funcs)
|
||||
array_init(return_value);
|
||||
|
||||
while (func->fname) {
|
||||
add_next_index_string(return_value, func->fname, 1);
|
||||
add_next_index_ascii_string(return_value, func->fname, 1);
|
||||
func++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,15 +396,9 @@ void zend_do_fetch_static_member(znode *result, znode *class_znode TSRMLS_DC)
|
||||
opline.result.u.EA.type = 0;
|
||||
opline.result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline.op1.op_type = IS_CONST;
|
||||
if (UG(unicode)) {
|
||||
opline.op1.u.constant.type = IS_UNICODE;
|
||||
Z_USTRVAL(opline.op1.u.constant) = eustrndup((UChar*)CG(active_op_array)->vars[result->u.var].name, CG(active_op_array)->vars[result->u.var].name_len);
|
||||
Z_USTRLEN(opline.op1.u.constant) = CG(active_op_array)->vars[result->u.var].name_len;
|
||||
} else {
|
||||
opline.op1.u.constant.type = IS_STRING;
|
||||
Z_STRVAL(opline.op1.u.constant) = estrndup(CG(active_op_array)->vars[result->u.var].name, CG(active_op_array)->vars[result->u.var].name_len);
|
||||
Z_STRLEN(opline.op1.u.constant) = CG(active_op_array)->vars[result->u.var].name_len;
|
||||
}
|
||||
ZVAL_TEXTL(&opline.op1.u.constant,
|
||||
CG(active_op_array)->vars[result->u.var].name,
|
||||
CG(active_op_array)->vars[result->u.var].name_len, 1);
|
||||
SET_UNUSED(opline.op2);
|
||||
opline.op2 = *class_znode;
|
||||
opline.op2.u.EA.type = ZEND_FETCH_STATIC_MEMBER;
|
||||
@@ -422,15 +416,9 @@ void zend_do_fetch_static_member(znode *result, znode *class_znode TSRMLS_DC)
|
||||
opline.result.u.EA.type = 0;
|
||||
opline.result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
opline.op1.op_type = IS_CONST;
|
||||
if (UG(unicode)) {
|
||||
opline.op1.u.constant.type = IS_UNICODE;
|
||||
Z_USTRVAL(opline.op1.u.constant) = eustrndup((UChar*)CG(active_op_array)->vars[opline_ptr->op1.u.var].name, CG(active_op_array)->vars[opline_ptr->op1.u.var].name_len);
|
||||
Z_USTRLEN(opline.op1.u.constant) = CG(active_op_array)->vars[opline_ptr->op1.u.var].name_len;
|
||||
} else {
|
||||
opline.op1.u.constant.type = IS_STRING;
|
||||
Z_STRVAL(opline.op1.u.constant) = estrndup(CG(active_op_array)->vars[opline_ptr->op1.u.var].name, CG(active_op_array)->vars[opline_ptr->op1.u.var].name_len);
|
||||
Z_STRLEN(opline.op1.u.constant) = CG(active_op_array)->vars[opline_ptr->op1.u.var].name_len;
|
||||
}
|
||||
ZVAL_TEXTL(&opline.op1.u.constant,
|
||||
CG(active_op_array)->vars[opline_ptr->op1.u.var].name,
|
||||
CG(active_op_array)->vars[opline_ptr->op1.u.var].name_len, 1);
|
||||
SET_UNUSED(opline.op2);
|
||||
opline.op2 = *class_znode;
|
||||
opline.op2.u.EA.type = ZEND_FETCH_STATIC_MEMBER;
|
||||
@@ -3513,15 +3501,9 @@ void zend_do_unset(znode *variable TSRMLS_DC)
|
||||
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
opline->opcode = ZEND_UNSET_VAR;
|
||||
opline->op1.op_type = IS_CONST;
|
||||
if (UG(unicode)) {
|
||||
opline->op1.u.constant.type = IS_UNICODE;
|
||||
Z_USTRLEN(opline->op1.u.constant) = CG(active_op_array)->vars[variable->u.var].name_len;
|
||||
Z_USTRVAL(opline->op1.u.constant) = eustrndup((UChar*)CG(active_op_array)->vars[variable->u.var].name, CG(active_op_array)->vars[variable->u.var].name_len);
|
||||
} else {
|
||||
opline->op1.u.constant.type = IS_STRING;
|
||||
Z_STRLEN(opline->op1.u.constant) = CG(active_op_array)->vars[variable->u.var].name_len;
|
||||
Z_STRVAL(opline->op1.u.constant) = estrndup(CG(active_op_array)->vars[variable->u.var].name, CG(active_op_array)->vars[variable->u.var].name_len);
|
||||
}
|
||||
ZVAL_TEXTL(&opline->op1.u.constant,
|
||||
CG(active_op_array)->vars[variable->u.var].name,
|
||||
CG(active_op_array)->vars[variable->u.var].name_len, 1);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->op2.u.EA.type = ZEND_FETCH_LOCAL;
|
||||
SET_UNUSED(opline->result);
|
||||
@@ -3556,15 +3538,9 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
|
||||
last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
|
||||
last_op->op1.op_type = IS_CONST;
|
||||
if (UG(unicode)) {
|
||||
last_op->op1.u.constant.type = IS_UNICODE;
|
||||
Z_USTRLEN(last_op->op1.u.constant) = CG(active_op_array)->vars[variable->u.var].name_len;
|
||||
Z_USTRVAL(last_op->op1.u.constant) = eustrndup((UChar*)CG(active_op_array)->vars[variable->u.var].name, CG(active_op_array)->vars[variable->u.var].name_len);
|
||||
} else {
|
||||
last_op->op1.u.constant.type = IS_STRING;
|
||||
Z_STRLEN(last_op->op1.u.constant) = CG(active_op_array)->vars[variable->u.var].name_len;
|
||||
Z_STRVAL(last_op->op1.u.constant) = estrndup(CG(active_op_array)->vars[variable->u.var].name, CG(active_op_array)->vars[variable->u.var].name_len);
|
||||
}
|
||||
ZVAL_TEXTL(&last_op->op1.u.constant,
|
||||
CG(active_op_array)->vars[variable->u.var].name,
|
||||
CG(active_op_array)->vars[variable->u.var].name_len, 1);
|
||||
SET_UNUSED(last_op->op2);
|
||||
last_op->op2.u.EA.type = ZEND_FETCH_LOCAL;
|
||||
last_op->result.u.var = get_temporary_variable(CG(active_op_array));
|
||||
|
||||
@@ -346,10 +346,8 @@ ZEND_API char *get_active_function_name(TSRMLS_D)
|
||||
|
||||
if (function_name) {
|
||||
return function_name;
|
||||
} else if (UG(unicode)) {
|
||||
return (char*) u_main;
|
||||
} else {
|
||||
return "main";
|
||||
return UG(unicode)?(char*)u_main:"main";
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1896,24 +1896,10 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
class_name = CG(active_class_entry)->name;
|
||||
}
|
||||
|
||||
if (UG(unicode)) {
|
||||
if (!class_name) {
|
||||
zendlval->value.ustr.len = 0;
|
||||
zendlval->value.ustr.val = USTR_MAKE("");
|
||||
} else {
|
||||
zendlval->value.ustr.len = u_strlen((UChar*)class_name);
|
||||
zendlval->value.ustr.val = eustrndup((UChar*)class_name, zendlval->value.ustr.len);
|
||||
}
|
||||
zendlval->type = IS_UNICODE;
|
||||
if (!class_name) {
|
||||
ZVAL_EMPTY_TEXT(zendlval);
|
||||
} else {
|
||||
if (!class_name) {
|
||||
zendlval->value.str.len = 0;
|
||||
zendlval->value.str.val = estrndup("", 0);
|
||||
} else {
|
||||
zendlval->value.str.len = strlen(class_name);
|
||||
zendlval->value.str.val = estrndup(class_name, zendlval->value.str.len);
|
||||
}
|
||||
zendlval->type = IS_STRING;
|
||||
ZVAL_TEXT(zendlval, class_name, 1);
|
||||
}
|
||||
return T_CLASS_C;
|
||||
}
|
||||
@@ -1928,24 +1914,10 @@ NEWLINE ("\r"|"\n"|"\r\n")
|
||||
if (!func_name) {
|
||||
func_name = "";
|
||||
}
|
||||
if (UG(unicode)) {
|
||||
if (!func_name) {
|
||||
zendlval->value.ustr.len = 0;
|
||||
zendlval->value.ustr.val = USTR_MAKE("");
|
||||
} else {
|
||||
zendlval->value.ustr.len = u_strlen((UChar*)func_name);
|
||||
zendlval->value.ustr.val = eustrndup((UChar*)func_name, zendlval->value.ustr.len);
|
||||
}
|
||||
zendlval->type = IS_UNICODE;
|
||||
if (!func_name) {
|
||||
ZVAL_EMPTY_TEXT(zendlval);
|
||||
} else {
|
||||
if (!func_name) {
|
||||
zendlval->value.str.len = 0;
|
||||
zendlval->value.str.val = estrndup("", 0);
|
||||
} else {
|
||||
zendlval->value.str.len = strlen(func_name);
|
||||
zendlval->value.str.val = estrndup(func_name, zendlval->value.str.len);
|
||||
}
|
||||
zendlval->type = IS_STRING;
|
||||
ZVAL_TEXT(zendlval, func_name, 1);
|
||||
}
|
||||
return T_FUNC_C;
|
||||
}
|
||||
|
||||
@@ -245,12 +245,11 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
|
||||
}
|
||||
|
||||
|
||||
ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name TSRMLS_DC)
|
||||
ZEND_API int zend_check_property_access(zend_object *zobj, zend_uchar utype, void *prop_info_name TSRMLS_DC)
|
||||
{
|
||||
zend_property_info *property_info;
|
||||
char *class_name, *prop_name;
|
||||
zval member;
|
||||
zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
|
||||
|
||||
zend_u_unmangle_property_name(utype, prop_info_name, &class_name, &prop_name);
|
||||
if (utype == IS_UNICODE) {
|
||||
@@ -598,11 +597,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS)
|
||||
|
||||
ALLOC_ZVAL(method_name_ptr);
|
||||
INIT_PZVAL(method_name_ptr);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(method_name_ptr, (UChar*)func->function_name, 0); /* no dup - it's a copy */
|
||||
} else {
|
||||
ZVAL_STRING(method_name_ptr, func->function_name, 0); /* no dup - it's a copy */
|
||||
}
|
||||
ZVAL_TEXT(method_name_ptr, func->function_name, 0); /* no dup - it's a copy */
|
||||
|
||||
/* __call handler is called with two arguments:
|
||||
method name
|
||||
@@ -1019,22 +1014,18 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
|
||||
if (!zend_hash_exists(&Z_OBJCE_P(readobj)->function_table, "__tostring", sizeof("__tostring"))) {
|
||||
return FAILURE;
|
||||
}
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(&fname, USTR_MAKE("__tostring"), 0);
|
||||
} else {
|
||||
ZVAL_STRING(&fname, "__tostring", 0);
|
||||
}
|
||||
ZVAL_ASCII_STRING(&fname, "__tostring", 0);
|
||||
if (call_user_function_ex(NULL, &readobj, &fname, &retval, 0, NULL, 0, NULL TSRMLS_CC) == SUCCESS) {
|
||||
if (UG(unicode)) {
|
||||
zval_dtor(&fname);
|
||||
}
|
||||
if (retval) {
|
||||
if (Z_TYPE_P(retval) != IS_STRING && Z_TYPE_P(retval) != IS_UNICODE) {
|
||||
if (Z_TYPE_P(retval) != (UG(unicode)?IS_UNICODE:IS_STRING)) {
|
||||
zend_error(E_ERROR, "Method %v::__toString() must return a string value", Z_OBJCE_P(readobj)->name);
|
||||
}
|
||||
} else {
|
||||
MAKE_STD_ZVAL(retval);
|
||||
ZVAL_STRINGL(retval, "", 0, 1);
|
||||
ZVAL_ASCII_STRINGL(retval, "", 0, 1);
|
||||
}
|
||||
*writeobj = *retval;
|
||||
zval_copy_ctor(writeobj);
|
||||
|
||||
@@ -148,7 +148,7 @@ ZEND_API int zend_check_private(union _zend_function *fbc, zend_class_entry *ce,
|
||||
|
||||
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
|
||||
|
||||
ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name TSRMLS_DC);
|
||||
ZEND_API int zend_check_property_access(zend_object *zobj, zend_uchar utype, void *prop_info_name TSRMLS_DC);
|
||||
|
||||
ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS);
|
||||
END_EXTERN_C()
|
||||
|
||||
@@ -879,11 +879,7 @@ ZEND_API void zend_reflection_class_factory(zend_class_entry *ce, zval *object T
|
||||
zval *name;
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(name, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(name, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(name, ce->name, ce->name_length, 1);
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_class_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
intern->ptr = ce;
|
||||
@@ -930,11 +926,7 @@ static void reflection_parameter_factory(zend_function *fptr, struct _zend_arg_i
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (arg_info->name) {
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(name, (UChar*)arg_info->name, arg_info->name_len, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(name, arg_info->name, arg_info->name_len, 1);
|
||||
}
|
||||
ZVAL_TEXTL(name, arg_info->name, arg_info->name_len, 1);
|
||||
} else {
|
||||
ZVAL_NULL(name);
|
||||
}
|
||||
@@ -959,11 +951,7 @@ static void reflection_function_factory(zend_function *function, zval *object TS
|
||||
zval *name;
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)function->common.function_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, function->common.function_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, function->common.function_name, 1);
|
||||
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_function_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
@@ -983,13 +971,8 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)method->common.function_name, 1);
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, method->common.function_name, 1);
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, method->common.function_name, 1);
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_method_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
intern->ptr = method;
|
||||
@@ -1029,13 +1012,8 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)prop_name, 1);
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, prop_name, 1);
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, prop_name, 1);
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_property_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
@@ -1272,11 +1250,7 @@ ZEND_METHOD(reflection_function, __construct)
|
||||
}
|
||||
efree(lcname);
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)fptr->common.function_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, fptr->common.function_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, fptr->common.function_name, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL);
|
||||
intern->ptr = fptr;
|
||||
intern->free_ptr = 0;
|
||||
@@ -1725,11 +1699,7 @@ ZEND_METHOD(reflection_parameter, __construct)
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (arg_info[position].name) {
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(name, (UChar*)arg_info[position].name, arg_info[position].name_len, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(name, arg_info[position].name, arg_info[position].name_len, 1);
|
||||
}
|
||||
ZVAL_TEXTL(name, arg_info[position].name, arg_info[position].name_len, 1);
|
||||
} else {
|
||||
ZVAL_NULL(name);
|
||||
}
|
||||
@@ -1972,11 +1942,8 @@ ZEND_METHOD(reflection_method, __construct)
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
|
||||
zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);
|
||||
|
||||
lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len);
|
||||
@@ -1990,11 +1957,7 @@ ZEND_METHOD(reflection_method, __construct)
|
||||
efree(lcname);
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)mptr->common.function_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, mptr->common.function_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, mptr->common.function_name, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL);
|
||||
intern->ptr = mptr;
|
||||
intern->free_ptr = 0;
|
||||
@@ -2365,11 +2328,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
|
||||
|
||||
if (Z_TYPE_P(argument) == IS_OBJECT) {
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL);
|
||||
intern->ptr = Z_OBJCE_P(argument);
|
||||
if (is_object) {
|
||||
@@ -2386,11 +2345,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)((*ce)->name), (*ce)->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, (*ce)->name, (*ce)->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, (*ce)->name, (*ce)->name_length, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL);
|
||||
|
||||
intern->ptr = *ce;
|
||||
@@ -3381,20 +3336,12 @@ ZEND_METHOD(reflection_property, __construct)
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);
|
||||
|
||||
zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, &class_name, &prop_name);
|
||||
MAKE_STD_ZVAL(propname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(propname, (UChar*)prop_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(propname, prop_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(propname, prop_name, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &propname, sizeof(zval *), NULL);
|
||||
|
||||
reference = (property_reference*) emalloc(sizeof(property_reference));
|
||||
|
||||
@@ -3133,7 +3133,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
|
||||
zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_hash_move_forward(fe_ht);
|
||||
@@ -3195,7 +3195,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY)
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
|
||||
zend_hash_move_forward(fe_ht);
|
||||
} while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
|
||||
} while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) != SUCCESS);
|
||||
if (use_key) {
|
||||
zend_u_unmangle_property_name(key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key, &class_name, &prop_name);
|
||||
if (key_type == HASH_KEY_IS_UNICODE) {
|
||||
|
||||
@@ -2145,7 +2145,7 @@ static int ZEND_FE_RESET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
|
||||
zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_hash_move_forward(fe_ht);
|
||||
@@ -4653,7 +4653,7 @@ static int ZEND_FE_RESET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
|
||||
zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_hash_move_forward(fe_ht);
|
||||
@@ -7779,7 +7779,7 @@ static int ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
|
||||
zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_hash_move_forward(fe_ht);
|
||||
@@ -7841,7 +7841,7 @@ static int ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
|
||||
zend_hash_move_forward(fe_ht);
|
||||
} while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, str_key TSRMLS_CC) != SUCCESS);
|
||||
} while (key_type == HASH_KEY_NON_EXISTANT || zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) != SUCCESS);
|
||||
if (use_key) {
|
||||
zend_u_unmangle_property_name(key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key, &class_name, &prop_name);
|
||||
if (key_type == HASH_KEY_IS_UNICODE) {
|
||||
@@ -20460,7 +20460,7 @@ static int ZEND_FE_RESET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
|
||||
key_type = zend_hash_get_current_key_ex(fe_ht, &str_key, &str_key_len, &int_key, 0, NULL);
|
||||
if (key_type != HASH_KEY_NON_EXISTANT &&
|
||||
zend_check_property_access(zobj, str_key TSRMLS_CC) == SUCCESS) {
|
||||
zend_check_property_access(zobj, key_type == HASH_KEY_IS_UNICODE?IS_UNICODE:IS_STRING, str_key TSRMLS_CC) == SUCCESS) {
|
||||
break;
|
||||
}
|
||||
zend_hash_move_forward(fe_ht);
|
||||
|
||||
@@ -879,11 +879,7 @@ ZEND_API void zend_reflection_class_factory(zend_class_entry *ce, zval *object T
|
||||
zval *name;
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(name, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(name, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(name, ce->name, ce->name_length, 1);
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_class_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
intern->ptr = ce;
|
||||
@@ -930,11 +926,7 @@ static void reflection_parameter_factory(zend_function *fptr, struct _zend_arg_i
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (arg_info->name) {
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(name, (UChar*)arg_info->name, arg_info->name_len, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(name, arg_info->name, arg_info->name_len, 1);
|
||||
}
|
||||
ZVAL_TEXTL(name, arg_info->name, arg_info->name_len, 1);
|
||||
} else {
|
||||
ZVAL_NULL(name);
|
||||
}
|
||||
@@ -959,11 +951,7 @@ static void reflection_function_factory(zend_function *function, zval *object TS
|
||||
zval *name;
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)function->common.function_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, function->common.function_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, function->common.function_name, 1);
|
||||
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_function_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
@@ -983,13 +971,8 @@ static void reflection_method_factory(zend_class_entry *ce, zend_function *metho
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)method->common.function_name, 1);
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, method->common.function_name, 1);
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, method->common.function_name, 1);
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_method_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
intern->ptr = method;
|
||||
@@ -1029,13 +1012,8 @@ static void reflection_property_factory(zend_class_entry *ce, zend_property_info
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)prop_name, 1);
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, prop_name, 1);
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, prop_name, 1);
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
|
||||
reflection_instanciate(U_CLASS_ENTRY(reflection_property_ptr), object TSRMLS_CC);
|
||||
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
|
||||
@@ -1272,11 +1250,7 @@ ZEND_METHOD(reflection_function, __construct)
|
||||
}
|
||||
efree(lcname);
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)fptr->common.function_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, fptr->common.function_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, fptr->common.function_name, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL);
|
||||
intern->ptr = fptr;
|
||||
intern->free_ptr = 0;
|
||||
@@ -1725,11 +1699,7 @@ ZEND_METHOD(reflection_parameter, __construct)
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (arg_info[position].name) {
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(name, (UChar*)arg_info[position].name, arg_info[position].name_len, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(name, arg_info[position].name, arg_info[position].name_len, 1);
|
||||
}
|
||||
ZVAL_TEXTL(name, arg_info[position].name, arg_info[position].name_len, 1);
|
||||
} else {
|
||||
ZVAL_NULL(name);
|
||||
}
|
||||
@@ -1972,11 +1942,8 @@ ZEND_METHOD(reflection_method, __construct)
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
|
||||
zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);
|
||||
|
||||
lcname = zend_u_str_case_fold(type, name_str, name_len, 1, &lcname_len);
|
||||
@@ -1990,11 +1957,7 @@ ZEND_METHOD(reflection_method, __construct)
|
||||
efree(lcname);
|
||||
|
||||
MAKE_STD_ZVAL(name);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(name, (UChar*)mptr->common.function_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(name, mptr->common.function_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(name, mptr->common.function_name, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &name, sizeof(zval *), NULL);
|
||||
intern->ptr = mptr;
|
||||
intern->free_ptr = 0;
|
||||
@@ -2365,11 +2328,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
|
||||
|
||||
if (Z_TYPE_P(argument) == IS_OBJECT) {
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, Z_OBJCE_P(argument)->name, Z_OBJCE_P(argument)->name_length, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL);
|
||||
intern->ptr = Z_OBJCE_P(argument);
|
||||
if (is_object) {
|
||||
@@ -2386,11 +2345,7 @@ static void reflection_class_object_ctor(INTERNAL_FUNCTION_PARAMETERS, int is_ob
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)((*ce)->name), (*ce)->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, (*ce)->name, (*ce)->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, (*ce)->name, (*ce)->name_length, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &classname, sizeof(zval *), NULL);
|
||||
|
||||
intern->ptr = *ce;
|
||||
@@ -3381,20 +3336,12 @@ ZEND_METHOD(reflection_property, __construct)
|
||||
}
|
||||
|
||||
MAKE_STD_ZVAL(classname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODEL(classname, (UChar*)ce->name, ce->name_length, 1);
|
||||
} else {
|
||||
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
|
||||
}
|
||||
ZVAL_TEXTL(classname, ce->name, ce->name_length, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);
|
||||
|
||||
zend_u_unmangle_property_name(UG(unicode)?IS_UNICODE:IS_STRING, property_info->name, &class_name, &prop_name);
|
||||
MAKE_STD_ZVAL(propname);
|
||||
if (UG(unicode)) {
|
||||
ZVAL_UNICODE(propname, (UChar*)prop_name, 1);
|
||||
} else {
|
||||
ZVAL_STRING(propname, prop_name, 1);
|
||||
}
|
||||
ZVAL_TEXT(propname, prop_name, 1);
|
||||
zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) &propname, sizeof(zval *), NULL);
|
||||
|
||||
reference = (property_reference*) emalloc(sizeof(property_reference));
|
||||
|
||||
Reference in New Issue
Block a user