public function removeOne($value): bool
    {
        if ($this->isValidType($value) === false) {
            throw new MWrongTypeException("\$value", $this->getType(), $value);
        }

        $result = array_search($value, $this->list);

        if ($result === false) {
            throw new \OutOfBoundsException();
        }

        unset($this->list[$result]);

        return true;
    }
public function removeOne($value): bool
    {
        if ($this->isValidType($value) === false) {
            throw new MWrongTypeException("\$value", $this->getType(), $value);
        }

        $result = array_search($value, $this->list);

        if ($result === false) {
            throw new \OutOfBoundsException();
        }

        unset($this->list[$result]);

        return true;
    }
public function removeOne ( $ value ) : bool { if ( $ this -> isValidType ( $ value ) === false ) { throw new MWrongTypeException ( "\$value" , $ this -> getType ( ) , $ value ) ; } $ result = array_search ( $ value , $ this -> list ) ; if ( $ result === false ) { throw new \ OutOfBoundsException ( ) ; } unset ( $ this -> list [ $ result ] ) ; return true ; }
Removes the first occurrence of value in the list and returns true on success;
otherwise returns false.

@param $value mixed
@return bool
Removes the first occurrence of value in the list and returns true on success ; otherwise returns false .