Doc #54663 [Opn->Csd]: chdir() emits E_WARNING
| From: | nikic@php.net | Date: | Thu, 25 Aug 2011 20:51:23 +0000 |
| Subject: | Doc #54663 [Opn->Csd]: chdir() emits E_WARNING | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7062@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54663&edit=1
ID: 54663
Updated by: nikic@php.net
Reported by: alex dot schuch at gmx dot de
Summary: chdir() emits E_WARNING
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: -/-
PHP Version: Irrelevant
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Added a note in the errors section. (I didn't add the error suppression part as people tend to
consider that bad practice.)
Previous Comments:
------------------------------------------------------------------------
[2011-08-25 20:49:21] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&revision=315518
Log: Fix Doc Bug #54663: chdir() emits E_WARNING
------------------------------------------------------------------------
[2011-06-30 01:07:49] philip@php.net
The online documentation editor link relevant to this bug report:
https://edit.php.net/?project=PHP&perm=en/function.chdir.php
And the chdir() source code:
http://lxr.php.net/opengrok/xref/PHP_5_3/ext/standard/dir.c#317
------------------------------------------------------------------------
[2011-05-04 20:32:39] alex dot schuch at gmx dot de
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 this bug report at https://bugs.php.net/bug.php?id=54663&edit=1