The transition from viscous to brittle behavior in magmas plays a decisive role in determining the style of volcanic eruptions. While this transition has been determined for one- or two-phase systems, it remains poorly constrained for natural magmas containing silicic melt, crystals, and gas bubbles. Here, we present new experimental results on shear-induced fracturing of three-phase magmas obtained at high-temperature (673–1023 K) and high-pressure (200 MPa) conditions over a wide range of strain-rates (5·10-6 s-1–4·10-3 s-1). During the experiments bubbles are deformed (i.e., capillary number is in excess of 1) enough to coalesce and generate a porous network that potentially leads to outgassing. A physical relationship is proposed that quantifies the critical stress required for magmas to fail as a function of both crystal (0.24–0.65) and bubble volume fractions (0.09–0.12). The presented results demonstrate efficient outgassing for low crystal fraction (0.44) promote gas bubble entrapment and inhibit outgassing. The failure of bubble-free, crystal-bearing systems is enhanced by the presence of bubbles that lower the critical failure stress in a regime of efficient outgassing, while the failure stress is increased if bubbles remain trapped within the crystal framework. These contrasting behaviors have direct impact on the style of volcanic eruptions. During magma ascent, efficient outgassing reduces the potential for an explosive eruption and favors brittle behavior, contributing to maintain low overpressures in an active volcanic system resulting in effusion or rheological flow blockage of magma at depth. Conversely, magmas with high crystallinity experience limited loss of exsolved gas, permitting the achievement of larger overpressures prior to a potential sudden transition to brittle behavior, which could result in an explosive volcanic eruption.