spl 教程一 基础应用


spl 是什么

* SPLStandard PHP LibraryPHP标准库)的缩写。
*
根据官方定义,它是“a collection of interfaces and classes that are meant tosolve standard problems
*
目前在使用中,SPL更多地被看作是一种使object(物体)模仿array(数组)行为的interfacesclasses




spl可以干什么用

 /*** spl 作用* (1) 提供了一系列的标准的数据机构SplDoublyLinkedList — The SplDoublyLinkedList classSplStack — The SplStack classSplQueue — The SplQueue classSplHeap — The SplHeap classSplMaxHeap — The SplMaxHeap classSplMinHeap — The SplMinHeap classSplPriorityQueue — The SplPriorityQueue classSplFixedArray — The SplFixedArray classSplObjectStorage — The SplObjectStorage class* (2) 提供了一系列迭代器AppendIterator — The AppendIterator classArrayIterator — The ArrayIterator classCachingIterator — The CachingIterator classCallbackFilterIterator — The CallbackFilterIterator classDirectoryIterator — The DirectoryIterator classEmptyIterator — The EmptyIterator classFilesystemIterator — The FilesystemIterator classFilterIterator — The FilterIterator classGlobIterator — The GlobIterator classInfiniteIterator — The InfiniteIterator classIteratorIterator — The IteratorIterator classLimitIterator — The LimitIterator classMultipleIterator — The MultipleIterator classNoRewindIterator — The NoRewindIterator classParentIterator — The ParentIterator classRecursiveArrayIterator — The RecursiveArrayIterator classRecursiveCachingIterator — The RecursiveCachingIterator classRecursiveCallbackFilterIterator — The RecursiveCallbackFilterIterator classRecursiveDirectoryIterator — The RecursiveDirectoryIterator classRecursiveFilterIterator — The RecursiveFilterIterator classRecursiveIteratorIterator — The RecursiveIteratorIterator classRecursiveRegexIterator — The RecursiveRegexIterator classRecursiveTreeIterator — The RecursiveTreeIterator classRegexIterator — The RegexIterator class*** (3) 提供了一系列接口Countable — The Countable interfaceOuterIterator — The OuterIterator interfaceRecursiveIterator — The RecursiveIterator interfaceSeekableIterator — The SeekableIterator interface* (4) 提供了一系列标准异常BadFunctionCallException — The BadFunctionCallException classBadMethodCallException — The BadMethodCallException classDomainException — The DomainException classInvalidArgumentException — The InvalidArgumentException classLengthException — The LengthException classLogicException — The LogicException classOutOfBoundsException — The OutOfBoundsException classOutOfRangeException — The OutOfRangeException classOverflowException — The OverflowException classRangeException — The RangeException classRuntimeException — The RuntimeException classUnderflowException — The UnderflowException classUnexpectedValueException — The UnexpectedValueException class*  (5) 一系列方法class_implements — Return the interfaces which are implemented by the given class or interfaceclass_parents — Return the parent classes of the given classclass_uses — Return the traits used by the given classiterator_apply — Call a function for every element in an iteratoriterator_count — Count the elements in an iteratoriterator_to_array — Copy the iterator into an arrayspl_autoload_call — Try all registered __autoload() function to load the requested classspl_autoload_extensions — Register and return default file extensions for spl_autoloadspl_autoload_functions — Return all registered __autoload() functionsspl_autoload_register — Register given function as __autoload() implementationspl_autoload_unregister — Unregister given function as __autoload() implementationspl_autoload — Default implementation for __autoload()spl_classes — Return available SPL classesspl_object_hash — Return hash id for given object***/



spl 案例和应用




本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部