php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54589 Example 1 for opendir() has a typo and won't work
Submitted: 2011-04-22 04:10 UTC Modified: 2011-04-22 04:47 UTC
From: jim_clark at pacbell dot net Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jim_clark at pacbell dot net
New email:
PHP Version: OS:

 

 [2011-04-22 04:10 UTC] jim_clark at pacbell dot net
Description:
------------
---
From manual page: http://us.php.net/manual/en/function.opendir.php
---
This line in the example:
  echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";

should be:
  echo "filename: $file : filetype: " . filetype($dir . "/" . $file) . "\n";



Test script:
---------------
1. copy-and-paste the example as shown - it will generate lstat errors
2. change the echo line as above, and it works.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-22 04:47 UTC] dtajchreber@php.net
-Status: Open +Status: Bogus
 [2011-04-22 04:47 UTC] dtajchreber@php.net
The example works fine... $dir has a trailing slash in the example... when you 
copied and pasted the example, did you modify the value of $dir? Did you include 
a trailing slash like in the example?
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 02:00:02 2026 UTC