HomeMenu
Bible PicturesGoogle
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

spl_object_hash

Description

The spl_object_hash of SPL for PHP returns the hash id for a given object.

Syntax

spl_object_hash(
    object $object
): string

Parameters

object

Any object.

Return

Returns a string that is unique for each currently existing object and is always the same for each object.

Examples

1 · object

<?

class myclass
{
}

$object = new myclass();

$return = spl_object_hash($object);

echo $return;
array(2) {
  [0]=>
  object(GMP)#3 (1) {
    ["num"]=>
    string(1) "0"
  }
  [1]=>
  object(GMP)#4 (1) {
    ["num"]=>
    string(1) "2"
  }
}