It isn't entirely true, it has to be "to the obstruction, annoyance, or danger of the residents or passengers" for it to be illegal https://www.legislation.gov.uk/ukpga/Vict/10-11/89
Although it does appear to be true in London https://www.legislation.gov.uk/ukpga/Vict/2-3/47/section/54