mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
30 lines
754 B
Plaintext
30 lines
754 B
Plaintext
|
--TEST--
|
||
|
Test dir() function : usage variations - open a file instead of directory
|
||
|
--FILE--
|
||
|
<?php
|
||
|
/*
|
||
|
* Prototype : object dir(string $directory[, resource $context])
|
||
|
* Description: Directory class with properties, handle and class and methods read, rewind and close
|
||
|
* Source code: ext/standard/dir.c
|
||
|
*/
|
||
|
|
||
|
/*
|
||
|
* Passing a file as argument to dir() function instead of a directory
|
||
|
* and checking if proper warning message is generated.
|
||
|
*/
|
||
|
|
||
|
echo "*** Testing dir() : open a file instead of a directory ***\n";
|
||
|
|
||
|
// open the file instead of directory
|
||
|
$d = dir(__FILE__);
|
||
|
var_dump( $d );
|
||
|
|
||
|
echo "Done";
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
*** Testing dir() : open a file instead of a directory ***
|
||
|
|
||
|
Warning: dir(%s): failed to open dir: %s in %s on line %d
|
||
|
bool(false)
|
||
|
Done
|