PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/strings/strrchr_error.php

http://github.com/facebook/hiphop-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
  1. <?php
  2. /* Prototype : string strrchr(string $haystack, string $needle);
  3. * Description: Finds the last occurrence of a character in a string.
  4. * Source code: ext/standard/string.c
  5. */
  6. echo "*** Testing strrchr() function: error conditions ***\n";
  7. $haystack = "Hello";
  8. $needle = "Hello";
  9. $extra_arg = "Hello";
  10. echo "\n-- Testing strrchr() function with Zero arguments --";
  11. var_dump( strrchr() );
  12. echo "\n-- Testing strrchr() function with less than expected no. of arguments --";
  13. var_dump( strrchr($haystack) );
  14. echo "\n-- Testing strrchr() function with more than expected no. of arguments --";
  15. var_dump( strrchr($haystack, $needle, $extra_arg) );
  16. echo "*** Done ***";
  17. ?>