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 cubrid mysql 兼容性函数 get column information from a result and return as an objectphp cubrid mysql 兼容性函数 fetch the next row and return it as an objectphp cubrid mysql 兼容性函数 return a string with the flags of the given field offsetphp 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 snmp 函数 return all values that are enums with their enum value instead of the raw integerphp snmp 函数 return all objects including their respective object id within the specified onephp 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 stream 函数 return a bucket object from the brigade for operating onphp mnogosearch 函数 return crc32 checksum of given stringphp mnogosearch 函数 return hash32 checksum of given stringphp sdo das xml 函数 to create sdo das xml object for a given schema filephp sdo 函数 return the name of the type for a data objectphp swish 函数 execute a query and return results object
关注编程学问公众号