com php-src: Get core test suite to really pass, fully. Woot: Zend/zend.h Zend/zend_interfaces.c Zend/zend_interfaces.h ext/s tandard/php_smart_str.h
ext/standard/php_smart_str _public.h ext/standard/string.c ext/standard/var.c
| From: | Anatol Belski | Date: | Wed, 16 Oct 2013 09:30:26 +0000 |
| Subject: | com php-src: Get core test suite to really pass, fully. Woot: Zend/zend.h Zend/zend_interfaces.c Zend/zend_interfaces.h ext/s tandard/php_smart_str.h ext/standard/php_smart_str _public.h ext/standard/string.c ext/standard/var.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73521@lists.php.net to get a copy of this message | ||
Commit: 2cf827b52a15fdb4468fbf004a4a286af0a1e73e
Author: Anthony Ferrara <ircmaxell@gmail.com> Tue, 2 Jul 2013 11:51:45 -0400
Committer: Anatol Belski <ab@php.net> Wed, 16 Oct 2013 02:30:26 -0700
Parents: 0cd95c1ee0092cd9528b08e25e5dcbdfe116dedd
Branches: str_size_and_int64
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2cf827b52a15fdb4468fbf004a4a286af0a1e73e
Log:
Get core test suite to really pass, fully. Woot
Changed paths:
M Zend/zend.h
M Zend/zend_interfaces.c
M Zend/zend_interfaces.h
M ext/standard/php_smart_str.h
M ext/standard/php_smart_str_public.h
M ext/standard/string.c
M ext/standard/var.c
diff --git a/Zend/zend.h b/Zend/zend.h index 196692a..9425bcc 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -512,8 +512,8 @@ struct _zend_class_entry { union _zend_function *(*get_static_method)(zend_class_entry *ce, char* method, zend_str_size_int method_len TSRMLS_DC); /* serializer callbacks */ - zend_str_size_int (*serialize)(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); - zend_str_size_int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); + int (*serialize)(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); + int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); zend_class_entry **interfaces; zend_uint num_interfaces; diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 31cd261..129c685 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -31,7 +31,7 @@ ZEND_API zend_class_entry *zend_ce_serializable; /* {{{ zend_call_method Only returns the returned zval if retval_ptr != NULL */ -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) +ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, zend_str_size_int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) { int result; zend_fcall_info fci; @@ -397,7 +397,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en /* }}}*/ /* {{{ zend_user_serialize */ -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC) { zend_class_entry * ce = Z_OBJCE_P(object); zval *retval; @@ -434,7 +434,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint /* }}} */ /* {{{ zend_user_unserialize */ -ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) +ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC) { zval * zdata; @@ -455,7 +455,7 @@ ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const un } /* }}} */ -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(object); zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name); @@ -463,7 +463,7 @@ ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zen } /* }}} */ -ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name); return FAILURE; diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index ba4bc6c..ec6dd51 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -38,7 +38,7 @@ typedef struct _zend_user_iterator { zval *value; } zend_user_iterator; -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC); +ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, zend_str_size_int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC); #define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \ zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC) @@ -61,11 +61,11 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c ZEND_API void zend_register_interfaces(TSRMLS_D); -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); END_EXTERN_C() diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h index 2fef1d0..7e8c491 100644 --- a/ext/standard/php_smart_str.h +++ b/ext/standard/php_smart_str.h @@ -88,13 +88,15 @@ smart_str_append_ex((dest), (src), 0) #define smart_str_append_long(dest, val) \ smart_str_append_long_ex((dest), (val), 0) +#define smart_str_append_str_size(dest, val) \ + smart_str_append_str_size_ex((dest), (val), 0) #define smart_str_append_off_t(dest, val) \ smart_str_append_off_t_ex((dest), (val), 0) #define smart_str_append_unsigned(dest, val) \ smart_str_append_unsigned_ex((dest), (val), 0) #define smart_str_appendc_ex(dest, ch, what) do { \ - register size_t __nl; \ + register zend_str_size __nl; \ smart_str_alloc4((dest), 1, (what), __nl); \ (dest)->len = __nl; \ ((unsigned char *) (dest)->c)[(dest)->len - 1] = (ch); \ @@ -110,7 +112,7 @@ } while (0) #define smart_str_appendl_ex(dest, src, nlen, what) do { \ - register size_t __nl; \ + register zend_str_size __nl; \ smart_str *__dest = (smart_str *) (dest); \ \ smart_str_alloc4(__dest, (nlen), (what), __nl); \ @@ -175,6 +177,9 @@ static inline char *smart_str_print_unsigned(char *buf, long num) { #define smart_str_append_long_ex(dest, num, type) \ smart_str_append_generic_ex((dest), (num), (type), unsigned long, _long) +#define smart_str_append_str_size_ex(dest, num, type) \ + smart_str_append_generic_ex((dest), (num), (type), zend_str_size, _long) + #define smart_str_append_off_t_ex(dest, num, type) \ smart_str_append_generic_ex((dest), (num), (type), off_t, _long) diff --git a/ext/standard/php_smart_str_public.h b/ext/standard/php_smart_str_public.h index ed36a7a..fdcb8b9 100644 --- a/ext/standard/php_smart_str_public.h +++ b/ext/standard/php_smart_str_public.h @@ -25,8 +25,8 @@ typedef struct { char *c; - size_t len; - size_t a; + zend_str_size len; + zend_str_size a; } smart_str; #endif diff --git a/ext/standard/string.c b/ext/standard/string.c index 631ed9a..e21b53b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2233,7 +2233,7 @@ PHP_FUNCTION(substr) l = str_len; } - if (f > str_len) { + if (f > 0 && f > str_len) { RETURN_FALSE; } else if (f < 0 && -f > str_len) { f = 0; diff --git a/ext/standard/var.c b/ext/standard/var.c index 9273363..585d043 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -593,7 +593,7 @@ static inline void php_var_serialize_long(smart_str *buf, long val) /* {{{ */ static inline void php_var_serialize_string(smart_str *buf, char *str, zend_str_size_int len) /* {{{ */ { smart_str_appendl(buf, "s:", 2); - smart_str_append_long(buf, len); + smart_str_append_str_size(buf, len); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, str, len); smart_str_appendl(buf, "\";", 2); @@ -606,7 +606,7 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc PHP_SET_CLASS_ATTRIBUTES(struc); smart_str_appendl(buf, "O:", 2); - smart_str_append_long(buf, (long)name_len); + smart_str_append_str_size(buf, name_len); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, class_name, name_len); smart_str_appendl(buf, "\":", 2); @@ -778,12 +778,12 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) { smart_str_appendl(buf, "C:", 2); - smart_str_append_long(buf, (int)Z_OBJCE_P(struc)->name_length); + smart_str_append_str_size(buf, Z_OBJCE_P(struc)->name_length); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, Z_OBJCE_P(struc)->name, Z_OBJCE_P(struc)->name_length); smart_str_appendl(buf, "\":", 2); - smart_str_append_long(buf, (int)serialized_length); + smart_str_append_str_size(buf, serialized_length); smart_str_appendl(buf, ":{", 2); smart_str_appendl(buf, serialized_data, serialized_length); smart_str_appendc(buf, '}');
diff --git a/Zend/zend.h b/Zend/zend.h index 196692a..9425bcc 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -512,8 +512,8 @@ struct _zend_class_entry { union _zend_function *(*get_static_method)(zend_class_entry *ce, char* method, zend_str_size_int method_len TSRMLS_DC); /* serializer callbacks */ - zend_str_size_int (*serialize)(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); - zend_str_size_int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); + int (*serialize)(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); + int (*unserialize)(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); zend_class_entry **interfaces; zend_uint num_interfaces; diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index 31cd261..129c685 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -31,7 +31,7 @@ ZEND_API zend_class_entry *zend_ce_serializable; /* {{{ zend_call_method Only returns the returned zval if retval_ptr != NULL */ -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) +ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, zend_str_size_int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC) { int result; zend_fcall_info fci; @@ -397,7 +397,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en /* }}}*/ /* {{{ zend_user_serialize */ -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC) { zend_class_entry * ce = Z_OBJCE_P(object); zval *retval; @@ -434,7 +434,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint /* }}} */ /* {{{ zend_user_unserialize */ -ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) +ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC) { zval * zdata; @@ -455,7 +455,7 @@ ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const un } /* }}} */ -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ { zend_class_entry *ce = Z_OBJCE_P(object); zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name); @@ -463,7 +463,7 @@ ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zen } /* }}} */ -ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ { zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name); return FAILURE; diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index ba4bc6c..ec6dd51 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -38,7 +38,7 @@ typedef struct _zend_user_iterator { zval *value; } zend_user_iterator; -ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC); +ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, const char *function_name, zend_str_size_int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC); #define zend_call_method_with_0_params(obj, obj_ce, fn_proxy, function_name, retval) \ zend_call_method(obj, obj_ce, fn_proxy, function_name, sizeof(function_name)-1, retval, 0, NULL, NULL TSRMLS_CC) @@ -61,11 +61,11 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c ZEND_API void zend_register_interfaces(TSRMLS_D); -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_str_size_uint *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_str_size_uint buf_len, zend_unserialize_data *data TSRMLS_DC); END_EXTERN_C() diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h index 2fef1d0..7e8c491 100644 --- a/ext/standard/php_smart_str.h +++ b/ext/standard/php_smart_str.h @@ -88,13 +88,15 @@ smart_str_append_ex((dest), (src), 0) #define smart_str_append_long(dest, val) \ smart_str_append_long_ex((dest), (val), 0) +#define smart_str_append_str_size(dest, val) \ + smart_str_append_str_size_ex((dest), (val), 0) #define smart_str_append_off_t(dest, val) \ smart_str_append_off_t_ex((dest), (val), 0) #define smart_str_append_unsigned(dest, val) \ smart_str_append_unsigned_ex((dest), (val), 0) #define smart_str_appendc_ex(dest, ch, what) do { \ - register size_t __nl; \ + register zend_str_size __nl; \ smart_str_alloc4((dest), 1, (what), __nl); \ (dest)->len = __nl; \ ((unsigned char *) (dest)->c)[(dest)->len - 1] = (ch); \ @@ -110,7 +112,7 @@ } while (0) #define smart_str_appendl_ex(dest, src, nlen, what) do { \ - register size_t __nl; \ + register zend_str_size __nl; \ smart_str *__dest = (smart_str *) (dest); \ \ smart_str_alloc4(__dest, (nlen), (what), __nl); \ @@ -175,6 +177,9 @@ static inline char *smart_str_print_unsigned(char *buf, long num) { #define smart_str_append_long_ex(dest, num, type) \ smart_str_append_generic_ex((dest), (num), (type), unsigned long, _long) +#define smart_str_append_str_size_ex(dest, num, type) \ + smart_str_append_generic_ex((dest), (num), (type), zend_str_size, _long) + #define smart_str_append_off_t_ex(dest, num, type) \ smart_str_append_generic_ex((dest), (num), (type), off_t, _long) diff --git a/ext/standard/php_smart_str_public.h b/ext/standard/php_smart_str_public.h index ed36a7a..fdcb8b9 100644 --- a/ext/standard/php_smart_str_public.h +++ b/ext/standard/php_smart_str_public.h @@ -25,8 +25,8 @@ typedef struct { char *c; - size_t len; - size_t a; + zend_str_size len; + zend_str_size a; } smart_str; #endif diff --git a/ext/standard/string.c b/ext/standard/string.c index 631ed9a..e21b53b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2233,7 +2233,7 @@ PHP_FUNCTION(substr) l = str_len; } - if (f > str_len) { + if (f > 0 && f > str_len) { RETURN_FALSE; } else if (f < 0 && -f > str_len) { f = 0; diff --git a/ext/standard/var.c b/ext/standard/var.c index 9273363..585d043 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -593,7 +593,7 @@ static inline void php_var_serialize_long(smart_str *buf, long val) /* {{{ */ static inline void php_var_serialize_string(smart_str *buf, char *str, zend_str_size_int len) /* {{{ */ { smart_str_appendl(buf, "s:", 2); - smart_str_append_long(buf, len); + smart_str_append_str_size(buf, len); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, str, len); smart_str_appendl(buf, "\";", 2); @@ -606,7 +606,7 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc PHP_SET_CLASS_ATTRIBUTES(struc); smart_str_appendl(buf, "O:", 2); - smart_str_append_long(buf, (long)name_len); + smart_str_append_str_size(buf, name_len); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, class_name, name_len); smart_str_appendl(buf, "\":", 2); @@ -778,12 +778,12 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) { smart_str_appendl(buf, "C:", 2); - smart_str_append_long(buf, (int)Z_OBJCE_P(struc)->name_length); + smart_str_append_str_size(buf, Z_OBJCE_P(struc)->name_length); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, Z_OBJCE_P(struc)->name, Z_OBJCE_P(struc)->name_length); smart_str_appendl(buf, "\":", 2); - smart_str_append_long(buf, (int)serialized_length); + smart_str_append_str_size(buf, serialized_length); smart_str_appendl(buf, ":{", 2); smart_str_appendl(buf, serialized_data, serialized_length); smart_str_appendc(buf, '}');