mirror of
https://github.com/php/php-src.git
synced 2026-04-23 07:58:20 +02:00
d776d25a8e
Make strspn($str1, $str2, $offset, $length) behaviorally equivalent to strspn(substr($str1, $offset, $length), $str2) by not throwing for out of bounds offset. There have been two reports that this change cause issues, including bug #80285.
21 lines
349 B
PHP
21 lines
349 B
PHP
--TEST--
|
|
Test strcspn() behavior
|
|
--FILE--
|
|
<?php
|
|
$a = "22222222aaaa bbb1111 cccc";
|
|
$b = "1234";
|
|
var_dump($a);
|
|
var_dump($b);
|
|
var_dump(strcspn($a,$b));
|
|
var_dump(strcspn($a,$b,9));
|
|
var_dump(strcspn($a,$b,9,6));
|
|
var_dump(strcspn('a', 'B', 1, 2147483647));
|
|
?>
|
|
--EXPECT--
|
|
string(25) "22222222aaaa bbb1111 cccc"
|
|
string(4) "1234"
|
|
int(0)
|
|
int(7)
|
|
int(6)
|
|
int(0)
|