php-src/ext/spl
Tyson Andre 5097e2ee13 Implement spl_object_id(object $x) : int
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)
2017-08-02 17:54:07 +02:00
..
examples
internal fix method "eof" 2017-06-23 07:53:00 +01:00
tests Implement spl_object_id(object $x) : int 2017-08-02 17:54:07 +02:00
config.m4 Drop HAVE_PACKED_OBJECT_VALUE 2015-10-06 23:12:34 +02:00
config.w32 made ext/date and ext/spl use static tsrm ls cache 2014-10-15 12:24:03 +02:00
CREDITS
doxygen.cfg
package.xml
php_spl.c Implement spl_object_id(object $x) : int 2017-08-02 17:54:07 +02:00
php_spl.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
README
spl_array.c Merge branch 'PHP-7.1' into PHP-7.2 2017-07-18 22:16:33 +02:00
spl_array.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_directory.c Resources should be closed during object destructioin, not during freeing. 2017-07-12 18:53:16 +03:00
spl_directory.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_dllist.c Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_dllist.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_engine.c Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_engine.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_exceptions.c Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_exceptions.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_fixedarray.c Merge branch 'PHP-7.0' into PHP-7.1 2017-05-24 18:02:13 +02:00
spl_fixedarray.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_functions.c Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_functions.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_heap.c Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_heap.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_iterators.c Merge branch 'PHP-7.1' into PHP-7.2 2017-08-01 16:02:36 +02:00
spl_iterators.h "Countable" interface is moved from SPL to Core 2017-05-25 12:47:43 +03:00
spl_observer.c Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl_observer.h Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
spl.php "Countable" interface is moved from SPL to Core 2017-05-25 12:47:43 +03:00
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