[When this was said, the Blessed One responded:] “I tell you, friend, that it is not possible by traveling to know or see or reach a far end of the cosmos where one does not take birth, age, die, pass away, or reappear. But at the same time, I tell you that there is no making an end of suffering & stress without reaching the end of the cosmos. Yet it is just within this fathom-long body, with its perception & intellect, that I declare that there is the cosmos, the origination of the cosmos, the cessation of the cosmos, and the path of practice leading to the cessation of the cosmos.”
It’s not to be reached by traveling,
the end of the cosmos —
regardless.
And it’s not without reaching
the end of the cosmos
that there is release
from suffering & stress.
So, truly, the wise one,
an expert with regard to the cosmos,
a knower of the end of the cosmos,
having fulfilled the holy life,
calmed,
knowing the cosmos’ end,
doesn’t long for this cosmos
or for any other. - AN 4.45
Loka is the pali word usually translated as world but by Ven Thanissaro here as cosmos.
See also:
At Savatthī. “Bhikkhus, I will teach you the origin and the passing away of the world. Listen to that and attend closely, I will speak.”
“Yes, venerable sir,” the bhikkhus replied. The Blessed One said this:
“And what, bhikkhus, is the origin of the world? In dependence on the eye and forms, eye-consciousness arises. The meeting of the three is contact. With contact as condition, feeling comes to be; with feeling as condition, craving; with craving as condition, clinging; with clinging as condition, existence; with existence as condition, birth; with birth as condition, aging-and-death, sorrow, lamentation, pain, displeasure, and despair come to be. This, bhikkhus, is the origin of the world.
“In dependence on the ear and sounds … In dependence on the nose and odours … In dependence on the tongue and tastes … In dependence on the body and tactile objects … In dependence on the mind and mental phenomena, mind-consciousness arises. The meeting of the three is contact. With contact as condition, feeling comes to be; with feeling as condition, craving; with craving as condition, clinging … existence … birth; with birth as condition, aging-and-death, sorrow, lamentation, pain, displeasure, and despair come to be. This, bhikkhus, is the origin of the world.
“And what, bhikkhus, is the passing away of the world? In dependence on the eye and forms, eye-consciousness arises. The meeting of the three is contact. With contact as condition, feeling comes to be; with feeling as condition, craving. But with the remainderless fading away and cessation of that same craving comes cessation of clinging; with the cessation of clinging, cessation of existence; with the cessation of existence, cessation of birth; with the cessation of birth, aging-and-death, sorrow, lamentation, pain, displeasure, and despair cease. Such is the cessation of this whole mass of suffering. This, bhikkhus, is the passing away of the world.
“In dependence on the ear and sounds … … In dependence on the mind and mental phenomena, mind-consciousness arises. The meeting of the three is contact. With contact as condition, feeling comes to be; with feeling as condition, craving. But with the remainderless fading away and cessation of that same craving comes cessation of clinging … cessation of existence … cessation of birth; with the cessation of birth, aging-and-death, sorrow, lamentation, pain, displeasure, and despair cease. Such is the cessation of this whole mass of suffering. This, bhikkhus, is the passing away of the world.”
Then the Venerable Ānanda approached the Blessed One … and said to him: “Venerable sir, it is said, ‘Empty is the world, empty is the world.’ In what way, venerable sir, is it said, ‘Empty is the world’?”
“It is, Ānanda, because it is empty of self and of what belongs to self that it is said, ‘Empty is the world.’ And what is empty of self and of what belongs to self? The eye, Ānanda, is empty of self and of what belongs to self. Forms are empty of self and of what belongs to self. Eye-consciousness is empty of self and of what belongs to self. Eye-contact is empty of self and of what belongs to self…. Whatever feeling arises with mind-contact as condition—whether pleasant or painful or neither-painful-nor-pleasant—that too is empty of self and of what belongs to self.
“It is, Ānanda, because it is empty of self and of what belongs to self that it is said, ‘Empty is the world.’”
However, the Buddha does not exclusively use world in this sense, sometimes he uses it in the common sense meaning.
At Savatthi. “Bhikkhus, I do not dispute with the world; rather, it is the world that disputes with me. A proponent of the Dhamma does not dispute with anyone in the world. Of that which the wise in the world agree upon as not existing, I too say that it does not exist. And of that which the wise in the world agree upon as existing, I too say that it exists.