| @@ 234-248 (lines=15) @@ | ||
| 231 | * |
|
| 232 | * @return int |
|
| 233 | */ |
|
| 234 | public function cspn(string $mask, int $start = 0, int $length = null): int |
|
| 235 | { |
|
| 236 | if ($length === null) { |
|
| 237 | $value = strcspn($this->value, $mask, $start); |
|
| 238 | } else { |
|
| 239 | $value = strcspn( |
|
| 240 | $this->value, |
|
| 241 | $mask, |
|
| 242 | $start, |
|
| 243 | $length |
|
| 244 | ); |
|
| 245 | } |
|
| 246 | ||
| 247 | return (int) $value; |
|
| 248 | } |
|
| 249 | ||
| 250 | /** |
|
| 251 | * Repeat the string n times |
|
| @@ 263-277 (lines=15) @@ | ||
| 260 | * |
|
| 261 | * @return int |
|
| 262 | */ |
|
| 263 | public function cspn(string $mask, int $start = 0, int $length = null): int |
|
| 264 | { |
|
| 265 | if ($length === null) { |
|
| 266 | $value = strcspn($this->value, $mask, $start); |
|
| 267 | } else { |
|
| 268 | $value = strcspn( |
|
| 269 | $this->value, |
|
| 270 | $mask, |
|
| 271 | $start, |
|
| 272 | $length |
|
| 273 | ); |
|
| 274 | } |
|
| 275 | ||
| 276 | return (int) $value; |
|
| 277 | } |
|
| 278 | ||
| 279 | /** |
|
| 280 | * Repeat the string n times |
|