Appendix B. SPL: The Standard PHP Library

SPL, the Standard PHP library—first introduced with PHP 5.0—provides many handy features for PHP projects. You’ll remember we mentioned its provision of iterator interfaces in Chapter 4—but this is just one of its many useful facets.

The Standard PHP Library is intended to provide best of breed interfaces—as well as abstract and concrete implementations of design patterns and solutions to common problems—while taking advantage of the new object oriented features provided in PHP 5.

ArrayAccess and ArrayObject

If you want to create an object that can be accessed using array syntax (and is seen as an array for all functions requiring one), you can implement the ArrayAccess interface. ...

Get PHP Master now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.