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
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/
SB>> > Anybody cares to explain what SPL is?
SB>>
SB>> http://cvs.php.net/cvs.php/splFrom 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