Re: File_Find / manual examples

From: Date: Fri, 15 Feb 2002 11:25:37 +0000
Subject: Re: File_Find / manual examples
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4728@lists.php.net to get a copy of this message
On Fri, 15 Feb 2002 13:31:15 +0200 (EET), Mika Tuupola wrote: > > Looking at the PEAR manual I can see examples using static > calls. However when trying to use a static call like this: > > $file = File_Find::maptree('/tmp/'); > > File_Find dies with: > > Warning: Problem with method call - please report this bug in > /usr/local/lib/php/File/Find.php on line 112 > > Warning: First argument to array_push() needs to be an array in > /usr/local/lib/php/File/Find.php on line 197 > > Warning: First argument to array_push() needs to be an array in > /usr/local/lib/php/File/Find.php on line 113 > > I can see the problem is array_push($this->files, $entry); > in the line 197. When using static call $this->files does > not get initialized as an array causing the error. > > > However if I use File_Find as an object: > > $f = new File_Find(); > $file = $f->maptree('/tmp/'); > > things work fine. > > Is there a reason why the examples in manual use static calls > (this is the case with many other manual entries too)? It's a bug in the manual. I will fix that later. - Martin

« previous php.pear.dev (#4728) next »