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