Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7306 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7268 invoked by uid 1010); 23 Jan 2004 22:39:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 7244 invoked from network); 23 Jan 2004 22:39:36 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 23 Jan 2004 22:39:36 -0000 Received: from [192.168.1.100] (p508EB35E.dip.t-dialin.net [80.142.179.94]) by shiva.mind.de (Postfix) with ESMTP id D9C3097B64; Fri, 23 Jan 2004 23:39:29 +0100 (CET) Date: Fri, 23 Jan 2004 23:41:08 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <4-1484044703.20040123234108@marcus-boerger.de> To: Adam Maccabee Trachtenberg Cc: Marcus Boerger , internals@lists.php.net In-Reply-To: References: <127-1489258859.20040123221414@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] SPL Examples Broken? From: helly@php.net (Marcus Boerger) Hello Adam, Friday, January 23, 2004, 11:18:09 PM, you wrote: > On Fri, 23 Jan 2004, Adam Maccabee Trachtenberg wrote: >> I will try rebuilding things and take a second look. > The tree.php example now works, but I am getting errors with > findfile.php: > [adam@benlev:~/CVS/php/php-src/ext/spl/examples] $ > ../../../sapi/cli/php -d auto_prepend_file=autoload.inc findfile.php > . findfile.php > PHP Notice: Undefined property: FindFile::$it in > /usr/local/cvs/php/php-src/ext/spl/examples/findfile.php on line 36 > PHP Fatal error: Call to a member function current() on a non-object > in /usr/local/cvs/php/php-src/ext/spl/examples/findfile.php on line 36 > /Users/adam/CVS/php/php-src/main/streams/streams.c(371) : Stream of > type 'dir' 0xac0e80 (path:(null)) was not closed Fixed too. Hey if you find some cool & easy examples please tell me. Lukas already mentioned some random iterator. That would require an interface that add a count() method to the Seekable interface. And an iterator class that randomly seeks and reads from such interfaces. Of course the class would need to build up an array of available indices and only return elements not read so far by dropping any read index from the available list when read. Best regards, Marcus mailto:helly@php.net