: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Unsets a specified offset.
* @link https://www.php.net/manual/en/arrayaccess.offsetunset.php
* @param mixed $offset The offset to unset.
public function offsetUnset( $offset ) {
unset( $this->callbacks[ $offset ] );
$this->priorities = array_keys( $this->callbacks );
* Returns the current element.
* @link https://www.php.net/manual/en/iterator.current.php
* @return array Of callbacks at current priority.
public function current() {
return current( $this->callbacks );
* Moves forward to the next element.
* @link https://www.php.net/manual/en/iterator.next.php
* @return array Of callbacks at next priority.
return next( $this->callbacks );
* Returns the key of the current element.
* @link https://www.php.net/manual/en/iterator.key.php
* @return mixed Returns current priority on success, or NULL on failure
return key( $this->callbacks );
* Checks if current position is valid.
* @link https://www.php.net/manual/en/iterator.valid.php
* @return bool Whether the current position is valid.
public function valid() {
return key( $this->callbacks ) !== null;
* Rewinds the Iterator to the first element.
* @link https://www.php.net/manual/en/iterator.rewind.php
public function rewind() {
reset( $this->callbacks );