All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ʻalayhi wa sallam, is His slave and Messenger.
The expression mentioned in the question is considered Kinayah (metaphor) of divorce. What determines whether it is actually a divorce or not is the husband's intention. If he intended divorce when saying those words, then divorce takes place; otherwise, it does not take place.
The Kinayah of divorce, according to scholars, is any expression that closely implies separation. The author of Mughni Al-Muhtaaj, who is a leading Shaafiʻi scholar, wrote, “Kinayah of divorce is any wording that indicates a short notice of separation but is not a common term of divorce, neither Islamically nor according to customary practice...”
The Hanbali scholar Ibn Qudaamah wrote regarding the metaphors of divorce on account of which divorce takes effect when accompanied by the husband's intention to issue a divorce, “...and all the expressions indicating separation and signifying divorce ...” [Al-Mughni]
Allah knows best.