2 /* Prototype : proto int iconv_strrpos(string haystack, string needle [, string charset])
3 * Description: Find position of last occurrence of a string within another
4 * Source code: ext/iconv/iconv.c
8 * Pass iconv_strrpos() different data types as $needle argument to test behaviour
11 echo "*** Testing iconv_strrpos() : usage variations ***\n";
13 // Initialise function arguments not being substituted
14 $haystack = 'hello, world';
17 //get an unset variable
24 public function __toString() {
34 // get a resource variable
35 $fp = fopen(__FILE__
, "r");
37 // unexpected values to be passed to $needle argument
76 /*22*/ @$undefined_var,
85 // loop through each element of $inputs to check the behavior of iconv_strrpos()
87 foreach($inputs as $input) {
88 echo "\n-- Iteration $iterator --\n";
89 try { var_dump( iconv_strrpos($haystack, $input, $encoding)); } catch (Exception
$e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__
.' on line '.__LINE__
."\n"; }