Doc #75485 [Opn->Csd]: rewinddir incorrect return type
| From: | vrana@php.net | Date: | Fri, 26 Jan 2018 09:27:15 +0000 |
| Subject: | Doc #75485 [Opn->Csd]: rewinddir incorrect return type | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15366@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75485&edit=1
ID: 75485
Updated by: vrana@php.net
Reported by: erik at evanv dot nl
Summary: rewinddir incorrect return type
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Linux
PHP Version: 7.1.11
-Assigned To:
+Assigned To: vrana
Block user comment: N
Private report: N
New Comment:
Added: "Returns NULL on success or FALSE on failure." I've kept the return type as
void because PHP Manual documents only the main return type and doesn't put the information
about functions returning FALSE in case of an error (which is very common) into the signature.
Previous Comments:
------------------------------------------------------------------------
[2018-01-26 09:25:16] vrana@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=343910
Log: Document rewinddir return value (bug #75485)
------------------------------------------------------------------------
[2017-11-03 16:45:39] erik at evanv dot nl
Description:
------------
---
From manual page: http://www.php.net/function.rewinddir
---
return type is specified as void but it is false in case of errors:
php > var_dump(rewinddir(fopen('/tmp/', 'r')));
PHP Warning: rewinddir(): 25 is not a valid Directory resource in php shell code on line 1
PHP Stack trace:
PHP 1. {main}() php shell code:0
PHP 2. rewinddir() php shell code:1
php shell code:1:
bool(false)
Test script:
---------------
var_dump(rewinddir(fopen('/tmp/', 'r')));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75485&edit=1