mb_stripos_error2.phpt [plain text]
--TEST--
Test mb_stripos() function : error conditions - Pass unknown encoding
--SKIPIF--
<?php
extension_loaded('mbstring') or die('skip');
function_exists('mb_stripos') or die("skip mb_stripos() is not available in this build");
?>
--FILE--
<?php
echo "*** Testing mb_stripos() : error conditions ***\n";
$haystack = b'Hello, world';
$needle = b'world';
$offset = 2;
$encoding = 'unknown-encoding';
var_dump( mb_stripos($haystack, $needle, $offset, $encoding) );
echo "Done";
?>
--EXPECTF--
*** Testing mb_stripos() : error conditions ***
Warning: mb_stripos(): Unknown encoding "unknown-encoding" in %s on line %d
bool(false)
Done