1--TEST--
2Test is_resource() function : error conditions
3--FILE--
4<?php
5/* Prototype  : bool is_resource  ( mixed $var  )
6 * Description:  Finds whether a variable is a resource
7 * Source code: ext/standard/type.c
8 */
9
10echo "*** Testing is_resource() : error conditions ***\n";
11
12echo "\n-- Testing is_resource() function with Zero arguments --\n";
13var_dump( is_resource() );
14
15echo "\n-- Testing is_resource() function with more than expected no. of arguments --\n";
16$res = fopen(__FILE__, "r");
17$extra_arg = 10;
18var_dump( is_resource($res, $extra_arg) );
19
20?>
21===DONE===
22--EXPECTF--
23*** Testing is_resource() : error conditions ***
24
25-- Testing is_resource() function with Zero arguments --
26
27Warning: is_resource() expects exactly 1 parameter, 0 given in %s on line %d
28bool(false)
29
30-- Testing is_resource() function with more than expected no. of arguments --
31
32Warning: is_resource() expects exactly 1 parameter, 2 given in %s on line %d
33bool(false)
34===DONE===
35