PageRenderTime 39ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/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
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 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. ?>