Re: Warning when using File/Find.php

From: Date: Tue, 21 Aug 2001 07:57:18 +0000
Subject: Re: Warning when using File/Find.php
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1642@lists.php.net to get a copy of this message
ahhrg!! When working with it, i found it out to be _very_ nice to return a empty array. why ? because that way I don't need an extra condition . foreach( File_Find::glob('\.php.*',$data['path']) as $file) .... Markus On Tue, Aug 21, 2001 at 05:07:12AM +0200, Tomas V.V.Cox wrote : > Markus Fischer wrote: > > > > I get > > > > Undefined variable: matches in > > <b>/public/mfischer-home/mfischer/php4/lib/php/File/Find.php</b> > > on line <b>91</b><br> > > > > when the glob doesn't match any file. > > Proper initialization of $matches would prevent this. > > > > Corrected, now returns null on no matches (and also no warning :-) > > Thanks, > > Tomas V.v.Cox -- Markus Fischer, http://guru.josefine.at/~mfischer/ EMail: mfischer@guru.josefine.at PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -All your scripts are belong to Zend-

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