Faqih Abu Layth As Samarqandi (rahimahullah) has cited this statement in his famous book, Tambihul Ghafilin.
(Tambihul Ghafilin, pg. 416/417)
Whomsoever sits and spends time in the company of eight types of people, Allah Ta’ala will increase him in certain qualities:
Whoever spends time in the company of the wealthy, Allah Ta’ala will increase his love and inclination for this world.
Whoever sits with the poor, Allah Ta’ala will increase his gratitude and his happiness with the decree of Allah.
Whoever spends time with the king [people of authority], Allah Ta’ala will increase his pride and the hardness of his heart.
Whoever spends time in the company of women, Allah Ta’ala will increase his ignorance and desires.
Whoever sits with children, Allah Ta’ala will increase in him the qualities of amusement and joking.
Whoever spends time in the company of [open] sinners, Allah Ta’ala will increase his audacity to carry out and perpetrate sins and will allow him to procrastinate repenting.
Whoever sits with the pious and righteous, Allah Ta’ala will increase his desire to do good deeds.
Whoever sits in the company of the Scholars, Allah Ta’ala will increase his knowledge and piety.
(Tambihul Ghafilin, pg. 416/417)
Whomsoever sits and spends time in the company of eight types of people, Allah Ta’ala will increase him in certain qualities:
Whoever spends time in the company of the wealthy, Allah Ta’ala will increase his love and inclination for this world.
Whoever sits with the poor, Allah Ta’ala will increase his gratitude and his happiness with the decree of Allah.
Whoever spends time with the king [people of authority], Allah Ta’ala will increase his pride and the hardness of his heart.
Whoever spends time in the company of women, Allah Ta’ala will increase his ignorance and desires.
Whoever sits with children, Allah Ta’ala will increase in him the qualities of amusement and joking.
Whoever spends time in the company of [open] sinners, Allah Ta’ala will increase his audacity to carry out and perpetrate sins and will allow him to procrastinate repenting.
Whoever sits with the pious and righteous, Allah Ta’ala will increase his desire to do good deeds.
Whoever sits in the company of the Scholars, Allah Ta’ala will increase his knowledge and piety.