ru_php/ext/intl/tests/grapheme_strrev.phpt

34 lines
866 B
PHP
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
grapheme_strrev function tests
--EXTENSIONS--
intl
--FILE--
<?php
function ut_main()
{
$res_str = '';
$tests = array(
array( "abc", "cba" ),
array( "土下座🙇‍♀を", "を🙇‍♀座下土" ),
array( "null\x00byte", "etyb\x00llun" ),
array( "مرحبًا", "اً بحرم" ),
array( "", ""),
);
foreach( $tests as $test ) {
$res_str .= "grapheme cluster for strrev - param {$test[0]} ";
$res_str .= grapheme_strrev($test[0]) . "\n";
}
return $res_str;
}
echo ut_main();
?>
--EXPECT--
grapheme cluster for strrev - param abc cba
grapheme cluster for strrev - param 土下座🙇‍♀を を🙇‍♀座下土
grapheme cluster for strrev - param nullbyte etybllun
grapheme cluster for strrev - param مرحبًا ابًحرم
grapheme cluster for strrev - param