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