I\'m looking at the PHP Manual, and I\'m not seeing a section on data structures that most languages have, such as lists and sets. Am I just blind or does PHP not have anything
For the Compulsory need of data structures please browse for the SPL(PHP Extensions). They are having data structures like heap,linked-list,.. etc...
PHP not having the list and set data structures exactly. but they can achieved by array(with n Dimentions), that provide the multiple data with single cluster
$variable = array(
'one' => array(1,'char',3),
'two' => explode("single", "Multiple strings"),
'three' => all(9,'nine',"nine")
);
They are not exactly as list or set. But array can replace that. So no need to search for another data structures.
As for today (PHP 7.4), only native structure is an array
. But from PHP7 extension DS appeared that includes new data structures and all of them are much faster than other implementations (including SPL recommended in accepted answer).
DS extension - PHP Manual
Interfaces: Collection
, Hashable
, Sequence
Classes: Vector
, Deque
, Map
, Pair
, Set
, Stack
, Queue
, PriorityQueue
Orginal article about extension