1--TEST-- 2Test readdir() function : usage variations - use file pointers 3--FILE-- 4<?php 5/* 6 * Open a file pointer using fopen and pass to readdir() to test behaviour 7 */ 8 9echo "*** Testing readdir() : usage variations ***\n"; 10 11// get a resource variable 12var_dump($fp = fopen(__FILE__, "r")); 13try { 14 var_dump( readdir($fp) ); 15} catch (\TypeError $e) { 16 echo $e->getMessage() . "\n"; 17} 18 19?> 20--EXPECTF-- 21*** Testing readdir() : usage variations *** 22resource(%d) of type (stream) 23readdir(): Argument #1 ($dir_handle) must be a valid Directory resource 24