Heat the butter in a sauté pan over moderate heat. Add the onions and cook until soft, about 8 minutes.
Whisk in the Philly cream cheese and let it melt. Fold in the spinach until evenly combined. Add up to 3 tablespoons water if the mixture seems too dry.
Sprinkle the nutmeg on top and season with salt and pepper and refrigerate.
Brush the tin with butter, and then each of the filo pastry sheets as you line the tin with them. Use half of the pastry for the bottom layer, placing the sheets in the tin evenly so that the pastry goes up the sides with a little overlapping the edges.
As the tin is square and the filo pastry is rectangular in shape, you should try to arrange the sheets so that each side is covered in turn. When you have used up half of the pastry, spread the filling evenly over the filo sheets.
Then carry on with the rest of the pastry in the same way. The last sheet on top should also be buttered well, and then with a sharp knife trim around the top edge of the tin to give a neat finish.
Cut parallel lines 4-5cm / 1½-2 inches apart to form diamond shapes or cut into squares, making sure you cut the filo bites right through to the bottom of the tin.
Bake until they are golden brown, 12-15 minutes. Cool slightly. And enjoy warm.