Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7302 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53655 invoked by uid 1010); 23 Jan 2004 21:12:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53631 invoked from network); 23 Jan 2004 21:12:47 -0000 Received: from unknown (HELO shiva.mind.de) (212.42.230.204) by pb1.pair.com with SMTP; 23 Jan 2004 21:12:47 -0000 Received: from [192.168.1.100] (p508EB35E.dip.t-dialin.net [80.142.179.94]) by shiva.mind.de (Postfix) with ESMTP id EAA4197CA8; Fri, 23 Jan 2004 22:12:35 +0100 (CET) Date: Fri, 23 Jan 2004 22:14:14 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <127-1489258859.20040123221414@marcus-boerger.de> To: Adam Maccabee Trachtenberg Cc: internals@lists.php.net In-Reply-To: References: 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, 9:48:42 PM, you wrote: > I'm trying to run the SPL examples and running into some > problems. Some of these I was able to work around, but I eventually > end up generating a 192 Mb core dump with a 1000+ line gdb > backtrace. It's actually quite an impressive crash. :) > First of all, I'm running under PHP 5 Beta 3 since the current CVS no > longer allows an Interface to implement an Interface. (Maybe this is > the biggest problem? I thought I rememebered Andi claim that Zeev will > be fixing this RSN?) > Second, there is a small typo in recursiveiteratoriterator.inc. Line > 67 has one extra closing ')'. I fixed this. > Next, I get an error that recursivedirectoryiterator.inc cannot be > found. Based on some guess work, I created this file and placed the > following PHP code inside: > class RecursiveDirectoryIterator extends DirectoryTreeIterator { } > I'm not sure if this is correct, but it allowed me to run the > following without any warnings: > ~/Documents/php/php-5.0.0b3/sapi/cli/php -d include_path=. > -d auto_prepend_file=autoload.inc tree.php ../../dba > Unfortunately, this gives a big core dump. :( > If anyone has some suggestions I'm happy to try them. In the meantime > I will start with a more basic example and see what pushes PHP over > the edge. Maybe that will give a more reasonable backtrace. (Marcus: I > will send you my current backtrace if you think it will be helpful.) The way you created RecursiveDirectoryIterator should be the problem. At least i hope so. The class is suppoed to implement interface RecursiveIterator which you are obviously missing. Apart from that the class is a built in class (or are you trying the code without ext/spl?). You can verify the existence of the class by the following line: $ php -r 'Reflection_Class::export("RecursiveDirectoryIterator");' You should then see an outut like this: Class [ class RecursiveDirectoryIterator extends DirectoryIterator implements Traversable, Iterator, RecursiveIterator ] { - Constants [0] { } [...] Where two things are important. First the fact that the class is an internal class and second that it implements interface RecursiveIterator. You may also send me the bt. But i know those funny bitches. Such lengthy bts occur when the error happens very deep inrecursion. And thanks for noticing the error in the example (i shouldn't rewrite test files when no longer using them). Best regards, Marcus mailto:helly@php.net