An open fence gate will close if a block adjacent to it is destroyed. Similarly it will close if an extended piston (with the extended arm in a block adjacent to the fence gate) withdraws.
Affects both survival and creative.
1. Place a fence gate on the ground
2. Open the gate
3. Place a block next to it
4. Destroy the block
You will see the gate closing automatically.