Skip to content

Commit

Permalink
id contains
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Sep 4, 2023
1 parent 695b669 commit 5897873
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Timer/Timers.php
Expand Up @@ -46,7 +46,8 @@ public function add(TimerInterface $timer)

public function contains(TimerInterface $timer)
{
return isset($this->timers[\spl_object_hash($timer)]);
$id = \PHP_VERSION_ID < 70200 ? \spl_object_hash($timer) : \spl_object_id($timer);
return isset($this->timers[$id]);
}

public function cancel(TimerInterface $timer)
Expand Down

0 comments on commit 5897873

Please sign in to comment.