note 129125 added to function.spl-object-hash
| From: | jasonlester at nope dot com | Date: | Sun, 24 Dec 2023 17:24:45 +0000 |
| Subject: | note 129125 added to function.spl-object-hash | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221079@lists.php.net to get a copy of this message | ||
obj->handle is an unsigned long that starts a 0 and is incremented by 1 every time an object is
created, it is not a true pointer such as if created by mallaoc() or similar.
/* {{{ Returns the integer object handle for the given object */
PHP_FUNCTION(spl_object_id)
{
zend_object *obj;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJ(obj)
ZEND_PARSE_PARAMETERS_END();
RETURN_LONG((zend_long)obj->handle);
}
/* }}} */
PHPAPI zend_string *php_spl_object_hash(zend_object *obj) /* {{{*/
{
return strpprintf(32, "%016zx0000000000000000", (intptr_t)obj->handle);
}
/* }}} */
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 2603:3023:2fa:100:ee80:bcc3:83aa:c510)
----
Manual Page -- https://php.net/manual/en/function.spl-object-hash.php
Edit -- https://main.php.net/note/edit/129125
Del: integrated -- https://main.php.net/note/delete/129125/integrated
Del: useless -- https://main.php.net/note/delete/129125/useless
Del: bad code -- https://main.php.net/note/delete/129125/bad+code
Del: spam -- https://main.php.net/note/delete/129125/spam
Del: non-english -- https://main.php.net/note/delete/129125/non-english
Del: in docs -- https://main.php.net/note/delete/129125/in+docs
Del: other reasons-- https://main.php.net/note/delete/129125
Reject -- https://main.php.net/note/reject/129125
Search -- https://main.php.net/manage/user-notes.php