1--TEST--
2Test iconv_strlen() function : error conditions - pass an unknown encoding
3--SKIPIF--
4<?php
5extension_loaded('iconv') or die('skip');
6function_exists('iconv_strlen') or die("skip iconv_strlen() is not available in this build");
7?>
8--FILE--
9<?php
10/*
11 * Test iconv_strlen when passed an unknown encoding
12 */
13
14echo "*** Testing iconv_strlen() : error ***\n";
15
16$string = 'abcdef';
17
18$encoding = 'unknown-encoding';
19
20var_dump(iconv_strlen($string, $encoding));
21
22?>
23--EXPECTF--
24*** Testing iconv_strlen() : error ***
25
26Warning: iconv_strlen(): Wrong encoding, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d
27bool(false)
28