spl_object_id

(PHP 7 >= 7.2.0)

spl_object_id Return the integer object handle for given object

说明

spl_object_id ( object $obj ) : int

This function returns a unique identifier for the object. The object id is unique for the lifetime of the object. Once the object is destroyed, its id may be reused for other objects. This behavior is similar to spl_object_hash().

参数

object

Any object.

返回值

An integer identifier that is unique for each currently existing object and is always the same for each object.

范例

Example #1 A spl_object_id() example

<?php
$id 
spl_object_id($object);
$storage[$id] = $object;
?>

注释

Note:

When an object is destroyed, its id may be reused for other objects.

相关文章
php spl 函数 return the traits used by the given classphp com 函数 returns a handle to an already running instance of a com objectphp cubrid mysql 兼容性函数 get column information from a result and return as an objectphp cubrid mysql 兼容性函数 return the type of the column corresponding to the given field offsetphp frontbase 函数 get column information from a result and return as an objectphp informix 函数 duplicates the given blob objectphp informix 函数 return the content of a blob objectphp informix 函数 return the content of the char objectphp mailparse 函数 returns a handle on a given section in a mimemessagephp maxdb 函数 frees stored result memory for the given statement handlephp snmp 函数 return all values that are enums with their enum value instead of the raw integerphp snmp 函数 fetch the snmp object which follows the given object idphp snmp 函数 return all objects including their respective object id within the specified onephp snmp 函数 fetch the snmp object which follows the given object idphp spl 函数 return the integer object handle for given objectphp sqlite 函数 executes a query against a given database and returns a result handlephp sdo das xml 函数 to create sdo das xml object for a given schema filephp sdo das xml 函数 returns sdo das xml document object for a given path to xml instance documentphp sdo 函数 return the name of the type for a data objectphp sdo 函数 return the namespace uri of the type for a data object
关注编程学问公众号