Skip to content
Closed
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions ext/spl/php_spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,11 @@ PHP_FUNCTION(spl_autoload_functions)
/* {{{ Return hash id for given object */
PHP_FUNCTION(spl_object_hash)
{
zval *obj;
zend_object *obj;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJ(obj)
ZEND_PARSE_PARAMETERS_END();

RETURN_NEW_STR(php_spl_object_hash(obj));
}
Expand All @@ -651,7 +651,7 @@ PHP_FUNCTION(spl_object_id)
}
/* }}} */

PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
PHPAPI zend_string *php_spl_object_hash(zend_object *obj) /* {{{*/
{
intptr_t hash_handle, hash_handlers;

Expand All @@ -661,7 +661,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj) /* {{{*/
SPL_G(hash_mask_init) = 1;
}

hash_handle = SPL_G(hash_mask_handle)^(intptr_t)Z_OBJ_HANDLE_P(obj);
hash_handle = SPL_G(hash_mask_handle)^(intptr_t)obj->handle;
hash_handlers = SPL_G(hash_mask_handlers);

return strpprintf(32, "%016zx%016zx", hash_handle, hash_handlers);
Expand Down
2 changes: 1 addition & 1 deletion ext/spl/php_spl.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ ZEND_END_MODULE_GLOBALS(spl)
ZEND_EXTERN_MODULE_GLOBALS(spl)
#define SPL_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(spl, v)

PHPAPI zend_string *php_spl_object_hash(zval *obj);
PHPAPI zend_string *php_spl_object_hash(zend_object *obj);

#endif /* PHP_SPL_H */
Loading