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

http://github.com/facebook/hiphop-php · PHP · 23 lines · 14 code · 5 blank · 4 comment · 0 complexity · 5255d01cea9e0aa72255c2499941be08 MD5 · raw file

  1. <?php
  2. /* Prototype : string strtr(string str, string from[, string to])
  3. * Description: Translates characters in str using given translation tables
  4. * Source code: ext/standard/string.c
  5. */
  6. echo "*** Testing strtr() : error conditions ***\n";
  7. $str = "string";
  8. $from = "string";
  9. $to = "STRING";
  10. $extra_arg = "extra_argument";
  11. echo "\n-- Testing strtr() function with Zero arguments --";
  12. var_dump( strtr() );
  13. echo "\n-- Testing strtr() function with less than expected no. of arguments --";
  14. var_dump( strtr($str) );
  15. echo "\n-- Testing strtr() function with more than expected no. of arguments --";
  16. var_dump( strtr($str, $from, $to, $extra_arg) );
  17. echo "Done";
  18. ?>