Mishkat al-Masabih 276
وَعَنْ عَلِيٍّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «يُوشِكُ أَنْ يَأْتِيَ عَلَى النَّاسِ زَمَانٌ لَا يَبْقَى مِنَ الْإِسْلَامِ إِلَّا اسْمُهُ وَلَا يَبْقَى مِنَ الْقُرْآنِ إِلَّا رَسْمُهُ مَسَاجِدُهُمْ عَامِرَةٌ وَهِيَ خَرَابٌ مِنَ الْهُدَى عُلَمَاؤُهُمْ شَرُّ مَنْ تَحْتَ أَدِيمِ السَّمَاءِ مِنْ عِنْدِهِمْ تَخْرُجُ الْفِتْنَةُ وَفِيهِمْ تَعُودُ» . رَوَاهُ الْبَيْهَقِيُّ فِي شُعَبِ الْإِيمَان
From ʿAli, who said: The Messenger of Allah ﷺ said: "Soon a time will come upon the people when nothing will remain of Islam except its name, and nothing will remain of the Quran except its writing. Their mosques will be full, yet empty of guidance. Their scholars will be the worst of those beneath the canopy of the sky; from them tribulation will come forth, and to them it will return." Reported by al-Bayhaqi in Shuʿab al-Iman.