He was asked about garlic, and he replied, "The Messenger of Allah ﷺ said, 'Whoever eats from this plant should not come near us nor pray with us.'"
أنه سئل عن الثوم فقال: قال رسول الله ﷺ: من أكل من هذه الشجرة، فلا يقربنا، ولا يصلي معنا.
Bukhari narrated it in the Book of Adhan (856), and Muslim narrated it in the Book of Mosques (562), both through Abdul-Aziz bin Suhayb, from Anas, who mentioned it.