It’s an onion. One that you’ll find quite common amongst home gardeners here. Apparently its a tree onion which means that the bulb grows at the tip of the stem (although they do have bulb at the bottom). We got some from a fellow gardener and cooked stir-fried with it. The bulb that is at the tip is called a bubblet and can be eaten.