|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49928 basicly, im used php 5.2.9
Submitted: 2009-10-19 20:55 UTC Modified: 2009-10-20 08:32 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.0%)
From: jmyeom at hotmail dot com Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 5.3.0 OS: txt file is a directory
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jmyeom at hotmail dot com
New email:
PHP Version: OS:


 [2009-10-19 20:55 UTC] jmyeom at hotmail dot com
im used php 5.2.9

after running some tests, it keeps telling me a txt file IS A DIRECTORy.. then fails to open it

if this is human error, im sorry and could you point me in the right direction?

Reproduce code:
function a($hutpear) {
	$abc = $hutpear;
	if ($handle = opendir($abc)) {
		while (false !== ($file = readdir($handle))) {
			if ($file != "." && $file != "..") {
				if  (!is_file($file)) {
					a($abc . "/" . $file);
				} else {
					echo "$file\n";


Expected result:

Actual result:
br />
<b>Warning</b>:  opendir(photos/1/thisisatextdocument.txt) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: Not a directory in <b>/home/y02wals/public_html/test.php</b> on line <b>6</b><br />


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-19 20:58 UTC] jmyeom at hotmail dot com
sorry, forgot this, a more detailed report is here:
 [2009-10-20 08:32 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 09:01:27 2024 UTC