| @@ 4393-4399 (lines=7) @@ | ||
| 4390 | return null; |
|
| 4391 | } |
|
| 4392 | ||
| 4393 | if ($offset || $length !== null) { |
|
| 4394 | $strTmp = self::substr($str, $offset, $length); |
|
| 4395 | if ($strTmp === false) { |
|
| 4396 | return null; |
|
| 4397 | } |
|
| 4398 | $str = (string)$strTmp; |
|
| 4399 | } |
|
| 4400 | ||
| 4401 | if (!isset($str[0])) { |
|
| 4402 | return null; |
|
| @@ 5271-5277 (lines=7) @@ | ||
| 5268 | */ |
|
| 5269 | public static function strspn(string $str, string $mask, int $offset = 0, int $length = null): int |
|
| 5270 | { |
|
| 5271 | if ($offset || $length !== null) { |
|
| 5272 | $strTmp = self::substr($str, $offset, $length); |
|
| 5273 | if ($strTmp === false) { |
|
| 5274 | $strTmp = ''; |
|
| 5275 | } |
|
| 5276 | $str = (string)$strTmp; |
|
| 5277 | } |
|
| 5278 | ||
| 5279 | if (!isset($str[0], $mask[0])) { |
|
| 5280 | return 0; |
|