Voting

: one plus seven?
(Example: nine)

The Note You're Voting On

jasonlester at nope dot com
1 year ago
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);
}
/* }}} */

<< Back to user notes page

To Top