spl_object_hash

Supported Versions: PHP 5 >= 5.2.0, PHP 7, PHP 8
Return hash id for given object
spl_object_hash(object $object): string
    public function add(TimerInterface $timer)

    {

        
$id \spl_object_hash($timer);

        
$this->timers[$id] = $timer;

        
$this->schedule[$id] = $timer->getInterval() + $this->updateTime();

        
$this->sorted false;
    public function contains(TimerInterface $timer)

    {

        return isset(
$this->timers[\spl_object_hash($timer)]);

    }



    public function 
cancel(TimerInterface $timer)
    public function cancel(TimerInterface $timer)

    {

        
$id \spl_object_hash($timer);

        unset(
$this->timers[$id], $this->schedule[$id]);

    }