|
@@ -6,7 +6,8 @@ namespace loyalsoft;
|
|
* 针对 int 数据做的特殊操作
|
|
* 针对 int 数据做的特殊操作
|
|
* @author gwang
|
|
* @author gwang
|
|
*/
|
|
*/
|
|
-class Ints {
|
|
|
|
|
|
+class Ints
|
|
|
|
+{
|
|
|
|
|
|
/**
|
|
/**
|
|
* int 骚操作, 提取第几位到第几位的值(左数)
|
|
* int 骚操作, 提取第几位到第几位的值(左数)
|
|
@@ -15,9 +16,10 @@ class Ints {
|
|
* @param int $len 截取长度
|
|
* @param int $len 截取长度
|
|
* @param bool $throwException 是否抛出异常,默认false
|
|
* @param bool $throwException 是否抛出异常,默认false
|
|
* @return string
|
|
* @return string
|
|
- * @throws ArgumentOutOfRangeException
|
|
|
|
|
|
+ * @throws \Exception
|
|
*/
|
|
*/
|
|
- public static function Slice(int $i, int $start, int $len, bool $throwException = false): int {
|
|
|
|
|
|
+ public static function Slice(int $i, int $start, int $len, bool $throwException = false): int
|
|
|
|
+ {
|
|
$i_len = strlen("$i");
|
|
$i_len = strlen("$i");
|
|
if ($throwException) {
|
|
if ($throwException) {
|
|
if ($start < 0 || $start > 18) {
|
|
if ($start < 0 || $start > 18) {
|