ZEND_PUTS(quote);
if (escape) {
char *str;
- int str_len;
+ int str_len;
str = php_addcslashes(out, clen, &str_len, 0, "'\\", 2 TSRMLS_CC);
PHPWRITE(str, str_len);
* private & protected values
*/
if (va_arg(args, int) &&
- ((hash_key->type == IS_STRING && hash_key->arKey.s[0] == 0) ||
- (hash_key->type == IS_UNICODE && hash_key->arKey.u[0] == 0))) {
+ ((hash_key->type == IS_STRING && hash_key->arKey.s[0] == 0) ||
+ (hash_key->type == IS_UNICODE && hash_key->arKey.u[0] == 0))
+ ) {
return 0;
}
php_printf("%*c[", level + 1, ' ');
PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC) /* {{{ */
{
HashTable *myht;
- char* tmp_str;
- int tmp_len;
- zstr class_name;
+ char* tmp_str;
+ int tmp_len;
+ zstr class_name;
zend_uint class_name_len;
switch (Z_TYPE_PP(struc)) {
register int len;
/* relies on "(long)" being a perfect hash function for data pointers,
- however the actual identity of an object has had to be determined
- by its object handle and the class entry since 5.0. */
+ * however the actual identity of an object has had to be determined
+ * by its object handle and the class entry since 5.0. */
if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) {
p = smart_str_print_long(id + sizeof(id) - 1,
(((size_t)Z_OBJCE_P(var) << 5)
if (var_old && zend_hash_find(var_hash, p, len, var_old) == SUCCESS) {
if (!Z_ISREF_P(var)) {
/* we still need to bump up the counter, since non-refs will
- be counted separately by unserializer */
+ * be counted separately by unserializer */
var_no = -1;
zend_hash_next_index_insert(var_hash, &var_no, sizeof(var_no), NULL);
}
static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, HashTable *var_hash TSRMLS_DC) /* {{{ */
{
int count;
- zend_bool incomplete_class;
+ zend_bool incomplete_class;
zstr star;
star.s = "*";
incomplete_class = php_var_serialize_class_name(buf, struc TSRMLS_CC);
/* count after serializing name, since php_var_serialize_class_name
- changes the count if the variable is incomplete class */
+ * changes the count if the variable is incomplete class */
count = zend_hash_num_elements(HASH_OF(retval_ptr));
if (incomplete_class) {
--count;
}
if (incomplete_class &&
- key_len == sizeof(MAGIC_MEMBER) &&
- ZEND_U_EQUAL(i, key, key_len-1, MAGIC_MEMBER, sizeof(MAGIC_MEMBER)-1)
+ key_len == sizeof(MAGIC_MEMBER) &&
+ ZEND_U_EQUAL(i, key, key_len-1, MAGIC_MEMBER, sizeof(MAGIC_MEMBER)-1)
) {
continue;
}
break;
}
efree(priv_name.v);
- zend_u_mangle_property_name(&prot_name, &prop_name_length, Z_TYPE_PP(name), star, 1, Z_UNIVAL_PP(name), Z_UNILEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
+ zend_u_mangle_property_name(&prot_name, &prop_name_length, Z_TYPE_PP(name), star, 1, Z_UNIVAL_PP(name), Z_UNILEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
if (zend_u_hash_find(Z_OBJPROP_P(struc), Z_TYPE_PP(name), prot_name, prop_name_length+1, (void *) &d) == SUCCESS) {
if (Z_TYPE_PP(name) == IS_UNICODE) {
php_var_serialize_unicode(buf, prot_name.u, prop_name_length);
ulong *var_already;
HashTable *myht;
- if (var_hash
- && php_add_var_hash(var_hash, struc, (void *) &var_already TSRMLS_CC) == FAILURE) {
+ if (var_hash && php_add_var_hash(var_hash, struc, (void *) &var_already TSRMLS_CC) == FAILURE) {
if (Z_ISREF_P(struc)) {
smart_str_appendl(buf, "R:", 2);
smart_str_append_long(buf, *var_already);
return;
}
- if (ce && ce != PHP_IC_ENTRY &&
- zend_hash_exists(&ce->function_table, "__sleep", sizeof("__sleep"))) {
+ if (ce && ce != PHP_IC_ENTRY && zend_hash_exists(&ce->function_table, "__sleep", sizeof("__sleep"))) {
INIT_PZVAL(&fname);
ZVAL_ASCII_STRINGL(&fname, "__sleep", sizeof("__sleep") - 1, 1);
res = call_user_function_ex(CG(function_table), &struc, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC);
} else {
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 */
+ * since we already wrote the length of the array before */
smart_str_appendl(buf,"N;", 2);
}
zval_ptr_dtor(&retval_ptr);
myht = Z_OBJPROP_P(struc);
}
/* count after serializing name, since php_var_serialize_class_name
- changes the count if the variable is incomplete class */
+ * changes the count if the variable is incomplete class */
i = myht ? zend_hash_num_elements(myht) : 0;
if (i > 0 && incomplete_class) {
--i;
}
if (incomplete_class &&
- key_len == sizeof(MAGIC_MEMBER) &&
- ZEND_U_EQUAL(i, key, key_len - 1, MAGIC_MEMBER, sizeof(MAGIC_MEMBER)-1)
+ key_len == sizeof(MAGIC_MEMBER) &&
+ ZEND_U_EQUAL(i, key, key_len - 1, MAGIC_MEMBER, sizeof(MAGIC_MEMBER) - 1)
) {
continue;
}
p = (const unsigned char*) buf;
PHP_VAR_UNSERIALIZE_INIT(var_hash);
- if (!php_var_unserialize(&return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) {
+ if (!php_var_unserialize(&return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
zval_dtor(return_value);
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)((char*)p - buf), buf_len);