34 lines
866 B
PHP
34 lines
866 B
PHP
--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 null |