1--TEST--
2Test iconv_substr() function : error conditions - Pass an unknown encoding
3--EXTENSIONS--
4iconv
5--FILE--
6<?php
7/*
8 * Pass an unknown encoding to iconv_substr() to test behaviour
9 */
10
11echo "*** Testing iconv_substr() : error conditions ***\n";
12
13$str = 'Hello, world';
14$start = 1;
15$length = 5;
16$encoding = 'unknown-encoding';
17
18var_dump( iconv_substr($str, $start, $length, $encoding));
19
20echo "Done";
21?>
22--EXPECTF--
23*** Testing iconv_substr() : error conditions ***
24
25Warning: iconv_substr(): Wrong encoding, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d
26bool(false)
27Done
28