mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
33 lines
879 B
PHP
33 lines
879 B
PHP
--TEST--
|
|
Test mb_strtolower() function : error conditions - pass an unknown encoding
|
|
--SKIPIF--
|
|
<?php
|
|
extension_loaded('mbstring') or die('skip');
|
|
function_exists('mb_strtolower') or die("skip mb_strtolower() is not available in this build");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding])
|
|
* Description: Returns a lowercased version of $sourcestring
|
|
* Source code: ext/mbstring/mbstring.c
|
|
*/
|
|
|
|
/*
|
|
* Pass an unknown encoding to mb_strtolower() to test behaviour
|
|
*/
|
|
|
|
echo "*** Testing mb_strtolower() : error conditions***\n";
|
|
|
|
$sourcestring = 'hello, world';
|
|
$encoding = 'unknown-encoding';
|
|
|
|
var_dump( mb_strtolower($sourcestring, $encoding) );
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
*** Testing mb_strtolower() : error conditions***
|
|
|
|
Warning: mb_strtolower(): Unknown encoding "unknown-encoding" in %s on line %d
|
|
bool(false)
|
|
===DONE===
|