diff --git a/src/Faker/Provider/zh_TW/Text.php b/src/Faker/Provider/zh_TW/Text.php index 3521f7a485..b442481382 100644 --- a/src/Faker/Provider/zh_TW/Text.php +++ b/src/Faker/Provider/zh_TW/Text.php @@ -129,7 +129,9 @@ protected static function appendEnd($text) // extract the last char of $text if ($mbAvailable) { - $last = mb_substr($text, mb_strlen($text, static::$encoding) - 1, null, static::$encoding); + // in order to support php 5.3, third param use 1 instead of null + // https://secure.php.net/manual/en/function.mb-substr.php#refsect1-function.mb-substr-changelog + $last = mb_substr($text, mb_strlen($text, static::$encoding) - 1, 1, static::$encoding); } else { $chars = static::utf8Encoding($text); $last = $chars[count($chars) - 1];