iconv_strlen_error2.phpt [plain text]
--TEST--
Test iconv_strlen() function : error conditions - pass an unknown encoding
--SKIPIF--
<?php
extension_loaded('iconv') or die('skip');
function_exists('iconv_strlen') or die("skip iconv_strlen() is not available in this build");
?>
--FILE--
<?php
echo "*** Testing iconv_strlen() : error ***\n";
$string = 'abcdef';
$encoding = 'unknown-encoding';
var_dump(iconv_strlen($string, $encoding));
?>
===DONE===
--EXPECTF--
*** Testing iconv_strlen() : error ***
Notice: iconv_strlen(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d
bool(false)
===DONE===