The Messenger of Allah said: "Whoever seeks knowledge in order to argue with the foolish, or to show off before the scholars, or to attract people's attention, will be in Hell." (Using translation from Ibn Mājah 253)
مَنْ طَلَبَ الْحَدِيثَ لِيُمَارِيَ بِهِ السُّفَهَاءَ أَوْ لِيُبَاهِيَ بِهِ الْعُلَمَاءَ أَوْ لِيَصْرِفَ بِهِ وُجُوهَ النَّاسِ إِلَيْهِ فَهُوَ فِي النَّارِ