File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -38,20 +38,21 @@ public function getTime()
3838
3939 public function add (TimerInterface $ timer )
4040 {
41- $ id = \spl_object_hash ($ timer );
41+ $ id = \PHP_VERSION_ID < 70200 ? \ spl_object_hash( $ timer ) : \spl_object_id ($ timer );
4242 $ this ->timers [$ id ] = $ timer ;
4343 $ this ->schedule [$ id ] = $ timer ->getInterval () + $ this ->updateTime ();
4444 $ this ->sorted = false ;
4545 }
4646
4747 public function contains (TimerInterface $ timer )
4848 {
49- return isset ($ this ->timers [\spl_object_hash ($ timer )]);
49+ $ id = \PHP_VERSION_ID < 70200 ? \spl_object_hash ($ timer ) : \spl_object_id ($ timer );
50+ return isset ($ this ->timers [$ id ]);
5051 }
5152
5253 public function cancel (TimerInterface $ timer )
5354 {
54- $ id = \spl_object_hash ($ timer );
55+ $ id = \PHP_VERSION_ID < 70200 ? \ spl_object_hash( $ timer ) : \spl_object_id ($ timer );
5556 unset($ this ->timers [$ id ], $ this ->schedule [$ id ]);
5657 }
5758
You can’t perform that action at this time.
0 commit comments