1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 18:23:26 +02:00
Files
archived-php-src/ext/standard/tests/dir/readdir_variation7.phpt
T
2019-08-30 09:50:04 +02:00

31 lines
687 B
PHP

--TEST--
Test readdir() function : usage variations - use file pointers
--FILE--
<?php
/* Prototype : string readdir([resource $dir_handle])
* Description: Read directory entry from dir_handle
* Source code: ext/standard/dir.c
*/
/*
* Open a file pointer using fopen and pass to readdir() to test behaviour
*/
echo "*** Testing readdir() : usage variations ***\n";
// get a resource variable
var_dump($fp = fopen(__FILE__, "r"));
try {
var_dump( readdir($fp) );
} catch (\TypeError $e) {
echo $e->getMessage() . "\n";
}
?>
===DONE===
--EXPECTF--
*** Testing readdir() : usage variations ***
resource(%d) of type (stream)
%d is not a valid Directory resource
===DONE===