The leaves of Hoplophyllum spinosum would be taken for spines if they had grown among differently shaped leaves on another plant type. Among spiny plants there are many with leaves of all shapes and sizes, as well as leafless ones.
The take on these hard-tipped, cylindrical protrusions is that they are indeed leaves. In the absence of alternative green surfaces, photosynthesis carries on here in both green spines (leaves) and younger stems, all longitudinally lined white and green.
The plant is known to be palatable to stock and game, suggesting at least periods of extreme hunger in herbivores with few appetising alternatives available, or excellent nibbling techniques adapted to or avoiding pain (Le Roux, et al, 2005; Leistner, (Ed.), 2000; iNaturalist; Wikipedia).