summaryrefslogtreecommitdiff
path: root/ext/standard/php_var.h
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2001-06-21 18:46:26 +0000
committerThies C. Arntzen <thies@php.net>2001-06-21 18:46:26 +0000
commitbd4f32cf126b53345c5a4a8f8a9431fcb2144ed1 (patch)
treebea3d2c22a2abad5318a7ef5dfaf17cee2a0956e /ext/standard/php_var.h
parent6ae7e5f54a0bb8ab292dd1b5e2cff60ff04fd481 (diff)
downloadphp-git-bd4f32cf126b53345c5a4a8f8a9431fcb2144ed1.tar.gz
- fixed the reference in session thingie
- regression test checked (this time;-) - added new regression test for references - references _between_ session variables also work in when the session var replaces an already existing global var (this was a brain twister) - saved one strlen call per session variable - fixed one tiny leak
Diffstat (limited to 'ext/standard/php_var.h')
-rw-r--r--ext/standard/php_var.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index ddaaf0fa12..7e2391adc3 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -43,6 +43,25 @@ int php_var_unserialize(pval **rval, const char **p, const char *max, php_serial
#define PHP_VAR_UNSERIALIZE_DESTROY(var_hash) \
zend_hash_destroy(&(var_hash))
+#define PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash,ozval,nzval) \
+if (var_hash) { \
+ HashPosition pos; \
+ zval **zval_ref; \
+ zend_hash_internal_pointer_reset_ex(var_hash,&pos); \
+ while (zend_hash_get_current_data_ex(var_hash, (void **) &zval_ref, &pos) == SUCCESS) { \
+ if (*zval_ref == ozval) { \
+ char *string_key; \
+ ulong str_key_len; \
+ ulong num_key; \
+ zend_hash_get_current_key_ex(var_hash, &string_key, &str_key_len, &num_key, 1, &pos); \
+ /* this is our hash and it _will_ be number indexed! */ \
+ zend_hash_index_update(var_hash, num_key, &nzval, sizeof(zval *), NULL); \
+ break; \
+ } \
+ zend_hash_move_forward_ex(var_hash,&pos); \
+ } \
+}
+
PHPAPI zend_class_entry *php_create_empty_class(char *class_name,int len);
#endif /* PHP_VAR_H */