mirror of
https://github.com/php/php-src.git
synced 2024-09-28 21:36:12 +00:00
5097e2ee13
spl_object_id is a new function returning the object handle, as a signed integer. Discussion for this new function is ongoing on php-internals, see https://marc.info/?t=143835274500003&r=1&w=2 The object id is unique for the lifetime of the object. When the object is garbage collected, different objects may & will have the same object id. - This is also the case for the string generated by spl_object_hash It is always possible to cast the object handle to a **signed** zend_long in php 7.2. _zend_object->handle is always of the type `uint32_t`. (zend_long is 32 bits on 32 bit builds, 64 bits on 64 bit builds) As of php 7.0, the object id uniquely identifies the object, there can't be two objects with the same id but different handlers (See the implementation of spl_object_hash) Skip the pointless XORing, as discussed in internals. - It was intended to avoid exposing in-memory addresses. - The object handle is not a memory address. - The output of var_dump() includes the object handle(id) |
||
---|---|---|
.. | ||
examples | ||
internal | ||
tests | ||
config.m4 | ||
config.w32 | ||
CREDITS | ||
doxygen.cfg | ||
package.xml | ||
php_spl.c | ||
php_spl.h | ||
README | ||
spl_array.c | ||
spl_array.h | ||
spl_directory.c | ||
spl_directory.h | ||
spl_dllist.c | ||
spl_dllist.h | ||
spl_engine.c | ||
spl_engine.h | ||
spl_exceptions.c | ||
spl_exceptions.h | ||
spl_fixedarray.c | ||
spl_fixedarray.h | ||
spl_functions.c | ||
spl_functions.h | ||
spl_heap.c | ||
spl_heap.h | ||
spl_iterators.c | ||
spl_iterators.h | ||
spl_observer.c | ||
spl_observer.h | ||
spl.php | ||
TODO |
This is an extension that aims to implement some efficient data access interfaces and classes. You'll find the classes documented using php code in the file spl.php or in the corresponding .inc file in the examples subdirectory. Based on the internal implementations or the files in the examples subdirectory there are also some .php files to experiment with. For more information look at: http://php.net/manual/en/book.spl.php