Annotation of embedaddon/php/ext/standard/tests/dir/readdir_variation7.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test readdir() function : usage variations - use file pointers
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : string readdir([resource $dir_handle])
! 6: * Description: Read directory entry from dir_handle
! 7: * Source code: ext/standard/dir.c
! 8: */
! 9:
! 10: /*
! 11: * Open a file pointer using fopen and pass to readdir() to test behaviour
! 12: */
! 13:
! 14: echo "*** Testing readdir() : usage variations ***\n";
! 15:
! 16: // get a resource variable
! 17: var_dump($fp = fopen(__FILE__, "r"));
! 18: var_dump( readdir($fp) );
! 19:
! 20: ?>
! 21: ===DONE===
! 22: --EXPECTF--
! 23: *** Testing readdir() : usage variations ***
! 24: resource(%d) of type (stream)
! 25:
! 26: Warning: readdir(): %d is not a valid Directory resource in %s on line %d
! 27: bool(false)
! 28: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>