WordPress files break if I edit them, but adding a closing PHP tag fixes it

WordPress files break if I edit them, but adding a closing PHP tag fixes it