/hphp/test/zend/bad/ext/standard/tests/strings/strtr_error.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
- <?php
- /* Prototype : string strtr(string str, string from[, string to])
- * Description: Translates characters in str using given translation tables
- * Source code: ext/standard/string.c
- */
- echo "*** Testing strtr() : error conditions ***\n";
- $str = "string";
- $from = "string";
- $to = "STRING";
- $extra_arg = "extra_argument";
- echo "\n-- Testing strtr() function with Zero arguments --";
- var_dump( strtr() );
- echo "\n-- Testing strtr() function with less than expected no. of arguments --";
- var_dump( strtr($str) );
- echo "\n-- Testing strtr() function with more than expected no. of arguments --";
- var_dump( strtr($str, $from, $to, $extra_arg) );
- echo "Done";
- ?>