var_dump function showing a object indentifier for each object output, for example:
$now = new \DateTimeImmutable();
var_dump($now);
The output is:
object(DateTimeImmutable)#412 (3) {
["date"]=>
string(26) "2016-04-29 21:31:55.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
Is this 412 is unique in group of all current objects ?
How to access this number more efficently ?
I don't think that internal identifier is something you have to worry about. If you want to save variables and restoring them later, you can use serialize()
and unserialize()
.
EDIT: may be spl_object_hash()
could be what you need?