The idea that pilots are "banned" from eating onions is largely a myth, but many choose to avoid them—along with garlic and beans—prior to a flight for practical physiological reasons related to cabin pressure. As an aircraft climbs, the air pressure in the cabin decreases (usually to an equivalent altitude of 6,000–8,000 feet). According to Boyle's Law, gas trapped in the body expands as pressure drops. Onions and other gas-producing foods can lead to significant gastrointestinal discomfort or "trapped gas" pain at high altitudes, which can be distracting for a pilot. Furthermore, because pilots share a very small, enclosed cockpit for many hours, avoiding pungent foods like onions and garlic is considered a point of professional courtesy to their co-pilot. There is no FAA regulation against onions, but many airline training programs in the past (including military altitude chamber training) advised avoiding them to reduce the risk of flatulence and discomfort during flight.