/hphp/test/zend/bad/ext/standard/tests/strings/strtolower-win32.php
PHP | 52 lines | 38 code | 7 blank | 7 comment | 2 complexity | c4766da554c4d1705b3f976b0f4394ee 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 strtolower ( string $str );
- Description:
- Returns string with all alphabetic characters converted to lowercase.
- */
- echo "*** Testing strtolower() with all 256 chars ***\n";
- for ($i=0; $i<=255; $i++){
- $char = chr($i);
- print(bin2hex($char))." => ".(bin2hex(strtolower("$char")))."\n";
- }
- echo "*** Testing strlower() with basic strings ***\n";
- $str = "Mary Had A liTTle LAmb and ShE loveD IT So\n";
- var_dump(strtolower($str));
- echo "\n*** Testing strtolower() with various strings ***";
- /* strings to pass strtolower() */
- $strings = array (
- "",
- "string",
- "stRINg0234",
- "1.233.344StrinG12333",
- "$$$$$$!!!!@@@@@@@ ABCDEF !!!***",
- "ABCD\0abcdABCD",
- NULL,
- TRUE,
- FALSE,
- array()
- );
- $count = 0;
- /* loop through to check possible variations */
- foreach ($strings as $string) {
- echo "\n-- Iteration $count --\n";
- var_dump( strtolower($string) );
- $count++;
- }
- echo "\n*** Testing strtolower() with two different case strings ***\n";
- if (strtolower("HeLLo woRLd") === strtolower("hEllo WORLD"))
- echo "strings are same, with Case Insensitive\n";
- else
- echo "strings are not same\n";
- echo "\n*** Testing error conditions ***";
- var_dump( strtolower() ); /* Zero arguments */
- var_dump( strtolower("a", "b") ); /* Arguments > Expected */
- echo "*** Done ***";
- ?>