Re: ADT, SPL

php.internals

Stanislav Malyshev

23 years ago
SB>> > Anybody cares to explain what SPL is? SB>> SB>> http://cvs.php.net/cvs.php/spl From the initial look at the code, it seems it contains a large parts of duplicated engine code. Which means, unless I am missing something, constant maintenance nightmare. Can't it be done without keeping another copy of entire Zend engine?
-- Stanislav Malyshev, Zend Products Engineer stas@zend.com http://www.zend.com/ +972-3-6139665 ext.109

Sebastian Bergmann

23 years ago
Stanislav Malyshev wrote:
> Can't it be done without keeping another copy of entire Zend engine?
As Sterling already mentioned, it should be merged into Zend at some point in time, preferably before PHP 5 :)
-- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ http://www.professionelle-softwareentwicklung-mit-php5.de/

Sterling Hughes

23 years ago
On Mon, 2003-06-23 at 03:34, Stanislav Malyshev wrote:
> SB>> > Anybody cares to explain what SPL is? > SB>> > SB>> http://cvs.php.net/cvs.php/spl > > >From the initial look at the code, it seems it contains a large parts of > duplicated engine code. Which means, unless I am missing something, > constant maintenance nightmare. Can't it be done without keeping another > copy of entire Zend engine?
SPL, or at least the parts I'm interested in provide a standard set of interfaces for PHP5, and then it overloads certain ops to allow for, for example, foreach() overloading. So you can do: class PHP_Devs implements spl_iterator { function next() { return $nextphpdev; } } $p = new PHP_Devs; foreach ($p as $dev) { echo $p; } This stuff is very useful, especially internally (its actually only the internal ramifications that i personally care about). Imagine developing a database extension, where you can go: $result = $sth->result; foreach ($result as $row) { echo $row[0]; } And *every* part of that is overloaded, and lazy initialized. That provides a great speed boost compared to the traditional database extensions (you save a lot of unnecessary function calls, and in some cases, fetches). Marcus can probably expound on some of the other features of SPL. -Sterling
-- "Microsoft isn't evil, they just make really crappy operating systems." - Linus Torvalds

(Marcus Börger)

23 years ago
Hello Stanislav, Monday, June 23, 2003, 9:34:41 AM, you wrote: SB>>> > Anybody cares to explain what SPL is? SB>>> SB>>> http://cvs.php.net/cvs.php/spl
>>From the initial look at the code, it seems it contains a large parts of
SM> duplicated engine code. Which means, unless I am missing something, SM> constant maintenance nightmare. Can't it be done without keeping another SM> copy of entire Zend engine? There a small parts of the engine in SPL which are simply needed because they are not exported by it. And then there is a modified version of call_user_function() which is quite different because spl has different needs...
-- Best regards, Marcus mailto:helly@php.net