Dear Rabbi Bartfeld,
Q. After davening I put my tefillin into its bag and into a larger bag.
While walking out of shul – my tefillin bag fell out of the larger bag and onto the floor.
Do I need to fast.  If so is that today or another day?

Thank you.

A. Mishna Berura (40: 3) rules that if the tefillin fell while they were in their bag, you do not have to fast. Yet he mentions in the name of the Eliahu Rabba that you should donate something to tz’daka.
Beir Heitev (O.C. 571 :1) Eliahu Rabba (40) Kaf Hachaim (40: 6) et. al. rule that when you have to fast, you do so in the day that the tefillin fell. This being similar to the fasting for a bad dream, that does not require acceptance at the mincha prayer on the prior day. Other Poskim disagree and maintain that it is better to fast next day when you can properly accept the ta’anis at the prior mincha. (Yalkut Yosef Tefillin 15. See also Ma’adaney Yom Tov 3: p.22).
Horav Shlomo Miller’s Shlit’a opinion is that if you have already eaten that day you should then fast the next day. He pointed out to Tosafos in Kidushin (5b) that you cannot have a fast on the day you already consumed food. Otherwise you should fast that same day.
Some Poskim connote that if the tefillin fell by accident and not because of negligence, giving to tz’daka suffices, (see Daas Torah 44:1, Chaim Shoal 12 and Shvivey Eish who argues that this would depend on the reasons why the fast was instituted.)
Horav Shlomo Miller Shlit”a agrees that this would constitute a mitigating circumstance if true, however, often people will incorrectly tend to deny responsibility for being negligent.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit”a.