1--TEST--
2Test dir() function : usage variations - open a file instead of directory
3--SKIPIF--
4<?php
5if (substr(PHP_OS, 0, 3) == 'WIN') {
6    die('skip.. Not valid for Windows');
7}
8?>
9--FILE--
10<?php
11/*
12 * Passing a file as argument to dir() function instead of a directory
13 * and checking if proper warning message is generated.
14 */
15
16echo "*** Testing dir() : open a file instead of a directory ***\n";
17
18// open the file instead of directory
19$d = dir(__FILE__);
20var_dump( $d );
21
22echo "Done";
23?>
24--EXPECTF--
25*** Testing dir() : open a file instead of a directory ***
26
27Warning: dir(%s): Failed to open directory: %s in %s on line %d
28bool(false)
29Done
30