The word “illegal” is applicable to everything which is an offence or which is prohibited by law, or which furnishes ground for a civil action; and a person is said to be “legally bound to do” whatever it is illegal in him to omit.
Section 43 IPC
“Illegal”. “Legally bound to do”
The Indian Penal Code, 1860 is repealed. It was replaced by The Bharatiya Nyaya Sanhita, 2023 from 1 July 2024; this provision still applies to matters that arose before then.