php-src/ext/mbstring/tests/mb_strstr_empty_needle.phpt
Nikita Popov a06d015e61 Remove unnecessary mbstring skipifs
These functions are always available (if the extension is available
at all).
2021-06-14 15:27:28 +02:00

35 lines
858 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
Test mb_strstr() function : with empty needle
--EXTENSIONS--
mbstring
--FILE--
<?php
mb_internal_encoding('UTF-8');
$string_ascii = 'abc def';
// Japanese string in UTF-8
$string_mb = "日本語テキストです。01234";
echo "\n-- ASCII string --\n";
var_dump(mb_strstr($string_ascii, '', false, 'ISO-8859-1'));
var_dump(mb_strstr($string_ascii, ''));
var_dump(mb_strstr($string_ascii, '', true));
echo "\n-- Multibyte string --\n";
var_dump(mb_strstr($string_mb, ''));
var_dump(mb_strstr($string_mb, '', false, 'utf-8'));
var_dump(mb_strstr($string_mb, '', true));
?>
--EXPECT--
-- ASCII string --
string(7) "abc def"
string(7) "abc def"
string(0) ""
-- Multibyte string --
string(53) "日本語テキストです。01234。"
string(53) "日本語テキストです。01234。"
string(0) ""