| @@ 4317-4323 (lines=7) @@ | ||
| 4314 | return null; |
|
| 4315 | } |
|
| 4316 | ||
| 4317 | if ($offset || $length !== null) { |
|
| 4318 | $strTmp = self::substr($str, $offset, $length); |
|
| 4319 | if ($strTmp === false) { |
|
| 4320 | return null; |
|
| 4321 | } |
|
| 4322 | $str = (string)$strTmp; |
|
| 4323 | } |
|
| 4324 | ||
| 4325 | if (!isset($str[0])) { |
|
| 4326 | return null; |
|
| @@ 5178-5184 (lines=7) @@ | ||
| 5175 | */ |
|
| 5176 | public static function strspn(string $str, string $mask, int $offset = 0, int $length = null): int |
|
| 5177 | { |
|
| 5178 | if ($offset || $length !== null) { |
|
| 5179 | $strTmp = self::substr($str, $offset, $length); |
|
| 5180 | if ($strTmp === false) { |
|
| 5181 | $strTmp = ''; |
|
| 5182 | } |
|
| 5183 | $str = (string)$strTmp; |
|
| 5184 | } |
|
| 5185 | ||
| 5186 | if (!isset($str[0], $mask[0])) { |
|
| 5187 | return 0; |
|