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 * Prototype : object dir(string $directory[, resource $context]) 13 * Description: Directory class with properties, handle and class and methods read, rewind and close 14 * Source code: ext/standard/dir.c 15 */ 16 17/* 18 * Passing a file as argument to dir() function instead of a directory 19 * and checking if proper warning message is generated. 20 */ 21 22echo "*** Testing dir() : open a file instead of a directory ***\n"; 23 24// open the file instead of directory 25$d = dir(__FILE__); 26var_dump( $d ); 27 28echo "Done"; 29?> 30--EXPECTF-- 31*** Testing dir() : open a file instead of a directory *** 32 33Warning: dir(%s): failed to open dir: %s in %s on line %d 34bool(false) 35Done 36