In the figure we have the way to implement a 5 to 45 V zener diode with 50 mA of maximum current using a general-purpose transistor. The modern equivalent BC548 can be used.