global statement removal: hphp/test/zend [2/x]
[hiphop-php.git] / hphp / test / zend / good / ext / iconv / tests / iconv_strrpos_error1.php
blob6fcd28ce2d6395c0d2d490504e6ac97e5df24511
1 <?php
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
5 */
7 /*
8 * Pass iconv_strrpos() an incorrect number of arguments
9 */
11 echo "*** Testing iconv_strrpos() : error conditions ***\n";
14 //Test iconv_strrpos with one more than the expected number of arguments
15 echo "\n-- Testing iconv_strrpos() function with more than expected no. of arguments --\n";
16 $haystack = 'string_val';
17 $needle = 'string_val';
18 $encoding = 'string_val';
19 $extra_arg = 10;
20 try { var_dump( iconv_strrpos($haystack, $needle, $encoding, $extra_arg) ); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
22 // Testing iconv_strrpos with one less than the expected number of arguments
23 echo "\n-- Testing iconv_strrpos() function with less than expected no. of arguments --\n";
24 $haystack = 'string_val';
25 try { var_dump( iconv_strrpos($haystack) ); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
27 echo "Done";