Nonexistence of global weak solutions for classes of nonlinear wave and parabolic equations