php SPL

SPL用於解決典型問題(standard problems)的一組接口與類的集合。

數據結構

SPL提供了一組標準數據結構。

雙向鏈表

雙向鏈表 (DLL) is a list of nodes linked in both directions to each others. Iterator's operations, access to both ends, addition or removal of nodes have a cost of O(1) when the underlying structure is a DLL. It hence provides a decent implementation for stacks and queues.

Heaps are tree-like structures that follow the heap-property: each node is greater than or equal to its children, when compared using the implemented compare method which is global to the heap.

陣列

Arrays are structures that store the data in a continuous way, accessible via indexes. Don't confuse them with PHP arrays: PHP arrays are in fact implemented as ordered hashtables.

映射

A map is a datastructure holding key-value pairs. PHP arrays can be seen as maps from integers/strings to values. SPL provides a map from objects to data. This map can also be used as an object set.

迭代器

SPL 提供一系列迭代器以遍歷不同的對象。

接口

SPL 提供一系列接口。

異常

SPL 提供一系列標準異常。

SPL函數

文件處理

SPL 提供 一些與文件相關的類。

其他類及接口

轉載鏈接:http://www.phpxs.com/post/1085/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章