Pass through (someone’s) mind

To think about something briefly, to remember something briefly.

It passed through my mind that I must go to the bank and get more money before my holiday.