|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-31 22:12 UTC] hostmaster at uuism dot net
[2008-10-31 22:13 UTC] hostmaster at uuism dot net
[2008-10-31 22:32 UTC] felipe@php.net
[2008-11-01 02:02 UTC] hostmaster at uuism dot net
[2008-11-01 04:10 UTC] hostmaster at uuism dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
Description: ------------ When I run test ext/standard/tests/dir/rewinddir_variation3 with PHP 5.2.6, the test fails because the Warning is not returned: When rewinddir() is executed with a file resource, PHP does not return an Warning message. The test expects that PHP will return "Warning: rewinddir(): %d is not a valid Directory resource in %s on line %d" Otherwise, the test results are fine. Jim Reproduce code: --------------- <?php /* Prototype : void rewinddir([resource $dir_handle]) * Description: Rewind dir_handle back to the start * Source code: ext/standard/dir.c * Alias to functions: rewind */ /* * Pass a file pointer to rewinddir() to test behaviour */ echo "*** Testing rewinddir() : usage variations ***\n"; echo "\n-- Open a file using fopen --\n"; var_dump($fp = fopen(__FILE__, 'r')); $result1 = fread($fp, 5); var_dump(rewinddir($fp)); $result2 = fread($fp, 5); echo "\n-- Check if rewinddir() has repositioned the file pointer --\n"; if ($result1 === $result2) { echo "rewinddir() works on file pointers\n"; } else { echo "rewinddir() does not work on file pointers\n"; } ?> Expected result: ---------------- *** Testing rewinddir() : usage variations *** -- Open a file using fopen -- resource(%d) of type (stream) Warning: rewinddir(): %d is not a valid Directory resource in %s on line %d bool(false) -- Check if rewinddir() has repositioned the file pointer -- rewinddir() does not work on file pointers Actual result: -------------- *** Testing rewinddir() : usage variations *** -- Open a file using fopen -- resource(5) of type (stream) NULL -- Check if rewinddir() has repositioned the file pointer -- rewinddir() works on file pointers