Sunan al-Darimi 386
أَخْبَرَنَا يَحْيَى بْنُ بِسْطَامَ، عَنْ يَحْيَى بْنِ حَمْزَةَ، حَدَّثَنِي النُّعْمَانُ، عَنْ مَكْحُولٍ، قَالَ: قَالَ رَسُولُ اللَّهِ ﷺ «مَنْ طَلَبَ الْعِلْمَ لِيُبَاهِيَ بِهِ الْعُلَمَاءَ، أَوْ لِيُمَارِيَ بِهِ السُّفَهَاءَ، أَوْ يُرِيدُ أَنْ يُقْبِلَ بِوُجُوهِ النَّاسِ إِلَيْهِ، أَدْخَلَهُ اللَّهُ جَهَنَّمَ»
Yahya ibn Bistam informed us, from Yahya ibn Hamzah; he said: An-Nuʿman narrated to me, from Makhul, who said: The Messenger of Allah ﷺ said: "Whoever seeks knowledge to boast with it before the scholars, or to dispute with the foolish by it, or wants to turn people's faces towards himself, Allah will admit him into Hell."