php標準庫(SPL)概述

伊谢尔伦
發布: 2016-11-21 17:50:18
原創
2283 人瀏覽過

SPL是用來解決典型問題(standard problems)的一組介面與類別的集合。

此擴充只能在php 5.0以後使用,並且從PHP 5.3.0 不再關閉,會一直有效,成為php核心元件一部分。

資料結構

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 ostost of Oan( a DLL. It hence provides a decent implementation for stacks and queues.

SplDoublyLinkedList

SplStack

SplQueue

SplQueue

💎 or equal to its children, when compared using the implemented compare method which is global to the heap.

SplHeap

SplMaxHeap

SplMinHeapuresplMinHeap

SplMaxHeap

SplMinHeapuresplMinHeap

SplMaxHeap

SplMinHeapurespli​​ial data in a continuous way, accessible via indexes. Don 't confuse them with PHP arrays: PHP arrays are in fact implemented as ordered hashtables.

SplFixedArray

映射

A map is a datastructure holding

映射

A map is a datastructure holding key-key-value value . SPL provides a map from objects to data. This map can also be used as an object set.

SplObjectStorage

迭代器

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

ArrayIterator

RecursiveArrayIterator

EmptyIterator

IteratorIterator

CallbackFilterIterator

erIterator

ParentIterator

RecursiveRegexIterator

RecursiveCachingIterator

AppendIterator

CachingIterator

AppendIterator

terI

NoRewindIterator

MultipleIterator

RecursiveIteratorIterator

RecursiveTreeIterator

DirectoryIterator (extends未來

FilesystemIterator

介面

SPL 提供一系列介面。

Countable

OuterIterator

RecursiveIterator

SeekableIterator

SplObserver

SplSubject

異常

SPL 提供一系列標準異常。

LogicException (extends Exception)

BadMethodCallException

BadFunctionCallException

DomainException

A

RuntimeException (extends Exception)

OutOfBoundsException

OverflowException

RangeException🎼函數

class_implements — 傳回指定的類別實作的所有介面。

class_parents — 傳回指定類別的父類別。

class_uses — Return the traits used by the given class

iterator_apply — 為迭代器中每個元素呼叫一個使用者自訂函數

iterator_countm— 計算器中迭代器中的個數個迭代器中的數量?元素拷貝到陣列

spl_autoload_call — 嘗試呼叫所有已註冊的__autoload()函數來裝載請求類別

spl_autoload_extensions — 註冊並傳回spl_autoload函數使用的預設檔案副檔名。

spl_autoload_functions — 傳回所有已註冊的__autoload()函數。

spl_autoload_register — 註冊__autoload()函數

spl_autoload_unregister — 登出已註冊的__autoload()函數

spl_autoload — __autoload() 函數的實作

spl_object_hash — 傳回指定物件的hash id

文件處理

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

SplFileInfo

SplFileObject

SplTempFileObject

其他類別及介面

ArrayObject

SplObserver

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!