1--TEST--
2Test fpassthru() function: Error conditions
3--FILE--
4<?php
5/*
6Prototype: int fpassthru ( resource $handle );
7Description: Reads to EOF on the given file pointer from the current position
8  and writes the results to the output buffer.
9*/
10
11echo "*** Test error conditions of fpassthru() function ***\n";
12
13/* Non-existing file resource */
14$no_file = fread("/no/such/file", "r");
15var_dump( fpassthru($no_file) );
16
17/* No.of args less than expected */
18var_dump( fpassthru() );
19
20/* No.of args greaer than expected */
21var_dump( fpassthru("", "") );
22
23echo "\n*** Done ***\n";
24
25?>
26--EXPECTF--
27*** Test error conditions of fpassthru() function ***
28
29Warning: fread() expects parameter 1 to be resource, string given in %s on line %d
30
31Warning: fpassthru() expects parameter 1 to be resource, bool given in %s on line %d
32bool(false)
33
34Warning: fpassthru() expects exactly 1 parameter, 0 given in %s on line %d
35bool(false)
36
37Warning: fpassthru() expects exactly 1 parameter, 2 given in %s on line %d
38bool(false)
39
40*** Done ***
41