File_Find / manual examples
| From: | Mika Tuupola | Date: | Fri, 15 Feb 2002 11:31:15 +0000 |
| Subject: | File_Find / manual examples | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-4727@lists.php.net to get a copy of this message | ||
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)?
--
Mika Tuupola http://www.appelsiini.net/~tuupola/