1--TEST--
2Test stripos() function : error conditions
3--FILE--
4<?php
5/* Prototype  : int stripos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of first occurrence of a case-insensitive string
7 * Source code: ext/standard/string.c
8*/
9
10echo "*** Testing stripos() function: error conditions ***\n";
11echo "\n-- With Zero arguments --";
12var_dump( stripos() );
13
14echo "\n-- With less than expected number of arguments --";
15var_dump( stripos("String") );
16
17echo "\n-- With more than expected number of arguments --";
18var_dump( stripos("string", "String", 1, 'extra_arg') );
19echo "*** Done ***";
20?>
21--EXPECTF--
22*** Testing stripos() function: error conditions ***
23
24-- With Zero arguments --
25Warning: stripos() expects at least 2 parameters, 0 given in %s on line %d
26NULL
27
28-- With less than expected number of arguments --
29Warning: stripos() expects at least 2 parameters, 1 given in %s on line %d
30NULL
31
32-- With more than expected number of arguments --
33Warning: stripos() expects at most 3 parameters, 4 given in %s on line %d
34NULL
35*** Done ***
36