Sometimes plant parts can evolve and take on new functions. Many plants have a part called a petiole that attaches the leaf to the stem. On some plants, the petiole has changed so that it looks just like a leaf and is called a phyllode. It develops the ability to photosynthesize and function as foliage.
Main stems like branches and flower stalks (known as rachis) can also become phyllodes.
Phyllodes are found on most species of acacia trees and shrubs. Many of them start out with true leaves as seedlings, but they fall off after the phyllodes have developed. The Mexican palo verde (Parkinsonia aculeata) also has phyllodes.
A similar adaptation of a stem is called a cladode.