Doc #54663 [NEW]: chdir() emits E_WARNING
| From: | alex dot schuch at gmx dot de | Date: | Wed, 04 May 2011 18:32:42 +0000 |
| Subject: | Doc #54663 [NEW]: chdir() emits E_WARNING | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-6341@lists.php.net to get a copy of this message | ||
From:
Operating system: -/-
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:chdir() emits E_WARNING
Description:
------------
---
From manual page: http://www.php.net/function.chdir#Return Values
---
The manual does not mention that chdir() emits an E_WARNING in case the
directory cannot be changed.
Test script:
---------------
> php -a
Interactive shell
php > var_dump(chdir('/fghfgh'));
PHP Warning: chdir(): No such file or directory (errno 2) in php shell
code on line 1
PHP Stack trace:
PHP 1. {main}() php shell code:0
PHP 2. chdir() php shell code:1
Warning: chdir(): No such file or directory (errno 2) in php shell code on
line 1
Call Stack:
8.4448 62776 1. {main}() php shell code:0
8.4448 62888 2. chdir() php shell code:1
bool(false)
Expected result:
----------------
Returns TRUE on success or FALSE and a PHP error of level E_WARNING on
failure. You can suppress the error output of chdir() by prepending '@' to
the front of the function name.
This is a rough adjusted rip from "opendir()" return value description.
Actual result:
--------------
-/-
--
Edit bug report at http://bugs.php.net/bug.php?id=54663&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54663&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54663&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54663&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54663&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54663&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54663&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54663&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54663&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54663&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54663&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54663&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54663&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54663&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54663&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54663&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54663&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54663&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54663&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54663&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54663&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54663&r=mysqlcfg