Skip to content

[skip ci] Document HASH_ constants #16806

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Zend/zend_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
#define HASH_KEY_IS_LONG 2
#define HASH_KEY_NON_EXISTENT 3

#define HASH_UPDATE (1<<0)
#define HASH_ADD (1<<1)
#define HASH_UPDATE_INDIRECT (1<<2)
#define HASH_ADD_NEW (1<<3)
#define HASH_ADD_NEXT (1<<4)
#define HASH_LOOKUP (1<<5)
#define HASH_UPDATE (1<<0) /* Create new entry, or update the existing one. */
#define HASH_ADD (1<<1) /* Create new entry, or fail if it exists. */
#define HASH_UPDATE_INDIRECT (1<<2) /* If the given ht entry is an indirect zval, unwrap it before writing to it. \
* When used with HASH_ADD, writing is allowed if the target zval is IS_UNDEF. */
#define HASH_ADD_NEW (1<<3) /* Used when the offset is known not to exist. */
#define HASH_ADD_NEXT (1<<4) /* Append to an array. (e.g. $array[] = 42;) */
#define HASH_LOOKUP (1<<5) /* Look up an existing entry, or create one with a NULL value. */

#define HASH_FLAG_CONSISTENCY ((1<<0) | (1<<1))
#define HASH_FLAG_PACKED (1<<2)
Expand Down