summaryrefslogtreecommitdiff
path: root/ext/iconv/tests/iconv_strlen_error2.phpt
blob: a4517f6e08f1338362ed5af5e3dfac9849384291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--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
/*
 * Test iconv_strlen when passed an unknown encoding
 */

echo "*** Testing iconv_strlen() : error ***\n";

$string = 'abcdef';

$encoding = 'unknown-encoding';

var_dump(iconv_strlen($string, $encoding));

?>
--EXPECTF--
*** Testing iconv_strlen() : error ***

Warning: iconv_strlen(): Wrong encoding, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d
bool(false)