It shall be unlawful for the owner or occupant of any improved premises, in any suburban district of a city or borough (whether the premises concerned be assessed at rural, suburban, or city rates), to erect any fence, or structure resembling a fence, or to reerect during the process of repairing, any fence previously erected, upon any part of the front yard, lawn, or space of said premises, or on or along the boundary line thereof, of a greater height than four feet, if the height in excess of the said four feet is unnecessary, or if the same is maliciously erected, elevated, and maintained for the purpose of annoying the owner or occupant of the adjoining premises. Every such fence or structure, so maliciously erected, elevated, and maintained in excess of four feet in height, shall be deemed, and is hereby declared to be, a private nuisance.
53 P.S. § 15171