A gradually shifting outlook within the Philippine government and growing dependence on Middle Eastern oil-producing countries have aroused concern among some U.S. officials about the future use of huge American naval and air bases here.

The subject of the bases is expected to come up during the state visit to Washington this week of Philippine President Ferdinand E. Marcos, who has indicated he intends to start prodding the Reagan administration toward a revised agreement on American use of the facilities.

The U.S. concerns stem from the emergence of what one diplomat called "a new independent foreign policy attitude toward Third World and socialist countries" and increasing reliance on Arab states for job markets and oil imports. While their anxieties deal with still hypothetical situations, some U.S. officials worry that in future contingencies -- for example, in the event of a major new Arab-Israeli crisis -- the United States may not be able to use the bases as freely as in the past.

The more immediate issues, once a date is fixed for a new round of negotiations, will be increased Philippine sovereignty over the bases and higher U.S. payments for their use, officials here said.

They indicated the Manila government hopes to use what would amount to a big rent increase for Clark Air Base and Subic Naval Base to help finance the modernization of its own Air Force and Navy.

Behind the Philippine thinking, as Marcos indicated to reporters last week, is the prospect that the government in the future may want to terminate the bases agreement, which is due to expire in 1991. U.S. officials currently consider the bases vital to American strategic interests.

At a news conference last Monday, Marcos said that "there is always a possibility" that Manila would terminate the bases agreement.

He explained that the Association of Southeast Asian Nations -- made up of the Philippines, Thailand, Indonesia, Singapore and Malaysia -- "has set as a long-term goal the establishment of a zone of peace, freedom and security, which means that no military bases can be sustained and tolerated within the region."

"But," he added, "we have always stated that this is a long-term goal, and this is sufficiently flexible for everybody to feel comfortable about it."

Western diplomats said the remarks indicated Marcos' perception that, despite strong ties with the Reagan administration, he must assert greater Philippine authority over the bases to keep pace with shifting attitudes here.

Aside from practical considerations, the bases issue packs some emotional baggage. It sometimes reflects the love-hate relationship that many Filipinos carry on with their former U.S. colonial master, which ruled the Philippines for nearly 50 years after seizing the archipelago from Spain in 1898.

The United States "is no longer dealing with bilateral relations based on special privilege," one diplomat said. "A whole new generation of technocrats," born after the Philippines gained independence following World War II, "is looking at the relationship in more equal terms now."

At a minimum, Marcos is expected to seek U.S. agreement during his state visit on a date to begin renegotiating the bases accord early next year. The 1979 agreement, which formally transferred Clark, Subic and three smaller installations to Philippine sovereignty, provides for review and possible revision every five years.

During the visit, the two sides may also announce agreement on customs, immigration and quarantine issues concerning the bases, officials here said. These matters were left unresolved in the 1979 agreement and have been the subject of intensive talks in recent weeks.

In the three-year negotiation leading to the 1979 agreement, the Philippines initially held out for "rent" of $1 billion over a five-year period, but settled for an aid package worth half that amount and not formally part of the bases agreement. Included was $250 million in foreign military sales credits, of which only $23 million has been used, largely because of high U.S. interest rates.

This time, according to a U.S. official, "the figure floating around" as the Philippines' asking price is $2 billion for the 1984-89 period, and Manila is expected to press for more grants instead of credits.

Asked this spring whether the Philippines would seek more money for use of the bases, Deputy Foreign Minister Pacifico Castro would say only that "there's inflation all over." He added that the government likely would "have a figure to work on" by the time Marcos made his state visit.

Potentially more troublesome than the money question, some U.S. officials feel, are the Philippines' growing ties with Arab countries, which provide a lucrative job market for Filipino workers and the bulk of the country's oil imports.

Currently as many as 250,000 Filipinos work in the Middle East, about 60 percent of them in Saudi Arabia. The government is eager to promote manpower export, which generates as much as $1 billion a year in remittances.

This growing Philippine dependence on the Middle East, particularly on Saudi Arabia, makes some diplomats wonder how useful the American bases would be in the event of a new Arab-Israeli crisis. They cite the Philippines' decision to bar the use of Clark Air Base for offensive missions during the Vietnam War.

"It's a matter of, I won't say hostages, but of a very substantial number of Filipinos in a war area in which the United States might take a certain position not in agreement with Arab countries," one U.S. analyst said earlier this year.

Another American official sees reason for concern in a joint communique on President Marcos' visit to Saudi Arabia in March. According to the source, the joint communique, which has not been made public here, expresses the Saudi position on Arab-Israeli issues and contains a vague clause recognizing the right of Middle Eastern countries to determine their security without interference from any outside power.

The clause has puzzled U.S. officials, who wonder whether it might commit the Philippines to restrict use of the American bases for certain purposes during a Middle East crisis.

After the 1973 Middle East war, when a U.S. supply airlift to Israel was hampered by the refusal of some European countries to permit overflights, the American military saw Clark Air Base as the key to a potential "back-door" channel. Now such a role seems dubious because of Manila's growing ties to the Arab states.

Although some opponents of Marcos have consistently opposed the presence of the U.S. bases, there is no sign that they have been able to galvanize much public support for their views."I don't detect a great deal of hostility," said a U.S. diplomat. "The overwhelming majority of Filipinos don't spend a lot of time thinking about the bases one way or the other."

The moderate opposition to Marcos, led by Assemblyman Salvador Laurel, takes a somewhat ambiguous position of opposing the bases "in principle" but standing by the treaty commitment that allows their presence until 1991.

"We know these bases are very important to the United States," Laurel said. "But we think the Reagan administration should take a second look at foreign policy toward the Philippines. The way the Reagan administration is going on, it's going to make Americans very ugly in this country."

Critics also charge that the bases are used to store nuclear weapons and could make the Philippines a target in a nuclear war.

American military officials decline to discuss the nuclear weapons issue. However, a standard briefing and slide show routinely given to visitors at Clark Air Base mentions that among the 48 combat aircraft stationed there are "nuclear-capable" F4 Phantom fighter-bombers.

Although the presence of the bases is resolutely opposed by the underground Communist Party of the Philippines, its military wing, the New People's Army, has refrained so far from taking any action against U.S. military personnel or installations. That it could easily do so is illustrated by reports of frequent intrusions onto Subic Naval Base by Filipinos who come to scavenge at a garbage dump not far from a complex of warehouses and officers' quarters.

One military analyst said that the bases "could well be something the Communists want to stay away from as long as possible to avoid bringing attention to themselves" as well as increased U.S. support for the Marcos government's counterinsurgency effort.

Although most of the original military reservation has been turned over to the Philippine government, Clark Air Base still ranks as the largest U.S. military installation outside the continental United States.

According to their commanders, the bases constitute an indispensable bulwark against a growing Soviet presence in Southeast Asia and support the U.S. 7th Fleet in the Indian Ocean. Officials say both bases are vital in projecting American military power to the Persian Gulf and as far away as Africa.

"If we ever lose the bases, it would be a devastating blow for us," a U.S. diplomat said. "If anything, the bases have become far more significant in the last couple of years" since the Soviet invasion of Afghanistan, the Moscow-backed Vietnamese invasion of Cambodia and the revolution in Iran, he said.

According to Col. John Corder, commander of the 3rd Tactical Fighter Wing at Clark Air Base, Soviet use of the port at Cam Ranh Bay in Vietnam has cut supply lines from Vladivostok to the Soviet Indian Ocean fleet in half.

"The Soviets have fewer attack forces in the area than we do, but that can change in one or two days," Corder said in an interview. "If we move back to Guam, it would become their lake, their sea lanes."

In such an event, Corder said, "The Japanese and the Koreans would be outflanked from their source of energy" and could become more susceptible to Soviet influence.