/hphp/test/zend/bad/ext/standard/tests/strings/strrchr_error.php
PHP | 22 lines | 13 code | 5 blank | 4 comment | 0 complexity | 0fc282b9d829458f44e9a83cb981ba35 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?php
- /* Prototype : string strrchr(string $haystack, string $needle);
- * Description: Finds the last occurrence of a character in a string.
- * Source code: ext/standard/string.c
- */
- echo "*** Testing strrchr() function: error conditions ***\n";
- $haystack = "Hello";
- $needle = "Hello";
- $extra_arg = "Hello";
- echo "\n-- Testing strrchr() function with Zero arguments --";
- var_dump( strrchr() );
- echo "\n-- Testing strrchr() function with less than expected no. of arguments --";
- var_dump( strrchr($haystack) );
- echo "\n-- Testing strrchr() function with more than expected no. of arguments --";
- var_dump( strrchr($haystack, $needle, $extra_arg) );
- echo "*** Done ***";
- ?>