In that situation the pins are floating - you can't expect to get any definite behaviour from a floating pin.