php-spl

SPL Autoloading best practices

In my include_path on the server-side I have a reference to a pear directory, in '/usr/share/pear/'. Within my applications I include files from a common library, living in '/usr/share/pear/library/' with require_once 'library/file.php'. I've recently started using the spl autoloader, I noticed in the loader function you have to determ...

Where is the source code of the PHP SPL library??

I can find the definition files at http://www.php.net/~helly/php/ext/spl/... but I want to extend DirectoryIterator and SplFileInfo to work over a virtual filesystem stored on a database... not a real filesystem... Many thanks... ...

PHP - SPL vs array:: When should we use SPL and when we should use array in php5?

Hi, In java and C++ when we dont know the size - array not used like in php, instead used linkedList etc.. In php exist SPL, but most of the times programers use array, why(because peaple don't know about spl )? When we should use in php5 array and when SPL and what the difference in this case between PHP and Java/C++? Thanks ...

Problem serializing an object tree with SplObjectStorage

I have implemented a simple Composite pattern using SplObjectStorage, like the example above: class Node { private $parent = null; public function setParent(Composite $parent) { $this->parent = $parent; } } class Composite extends Node { private $children; public function __construct() { $t...

What is the point of PHP's SplDoublyLinkedList class, and more importantly, Linked Lists in general?

On a quest to expand my programming prowess, I've delved ever-so-slightly into The Standard PHP Library. This led to my discovery of the SplDoublyLinkedList class. From there I read the descriptions of Linked Lists and Doubly Linked Lists on Wikipedia. I understand how they work... But I cannot conceive of a reason WHY we need itor b...