#22096 [Fbk->NoF]: return inside a while loop isn't breaking the loop and returning a value
| From: | sniper@php.net | Date: | Thu, 20 Feb 2003 14:08:50 +0000 |
| Subject: | #22096 [Fbk->NoF]: return inside a while loop isn't breaking the loop and returning a value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-33707@lists.php.net to get a copy of this message | ||
ID: 22096
Updated by: sniper@php.net
Reported By: enygma at phpdeveloper dot org
-Status: Feedback
+Status: No Feedback
Bug Type: *General Issues
Operating System: RedHat Linux
PHP Version: 4.2.2
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
And the latest PHP version is 4.3.1 nowadays..
Previous Comments:
------------------------------------------------------------------------
[2003-02-09 10:56:53] moriyoshi@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2003-02-06 15:09:30] enygma at phpdeveloper dot org
Here's the code I'm working with:
function getFilePath($filename,$path=''){
if(empty($path)){ $path=$this->basedir; }
echo $path."<br>";
if($dir=@opendir($path)){
while(false!==($file=readdir($dir))){
if(!in_array($file,$this->remove_array)){
$file_path=$path."/".$file;
if(is_file($file_path)){
if(strtolower($file)==strtolower($filename)){
$this->found_path=$file_path;
return $file_path;
}
}elseif(is_dir($file_path)){
$this->getFilePath($filename,$file_path);
}
}
}
}
closedir($dir);
//return $this->found_path;
}
Where it starts in one dir, and goes until it finds a file - then, when
it does, it's supposed to return that path value - but it doesn't. It
keeps going through the rest of the directories without stopping at the
"return"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22096&edit=1