strpbrk
Supported Versions: PHP 5, PHP 7, PHP 8
Search a string for any of a set of characters
strpbrk
(
string $string
,
string $characters
):
string
|
false
composer/composer
$ip6
=
substr
(
$hostName
,
1
,
$index
-
1
);
$hostName
=
substr
(
$hostName
,
$index
+
1
);
if (
strpbrk
(
$hostName
,
'[]'
) !==
false
||
substr_count
(
$hostName
,
':'
) >
1
) {
return
$error
;
}
}
src/Composer/Util/NoProxyPattern.php
composer/composer
$argument
=
strtr
(
$argument
,
"\n"
,
' '
);
$quote
=
strpbrk
(
$argument
,
" \t"
) !==
false
;
$argument
=
Preg
::
replace
(
'/(\\\\*)"/'
,
'$1$1\\"'
,
$argument
, -
1
,
$dquotes
);
$meta
=
$dquotes
||
Preg
::
isMatch
(
'/%[^%]+%|![^!]+!/'
,
$argument
);
src/Composer/Util/ProcessExecutor.php
composer/composer
$meta
=
$dquotes
||
Preg
::
isMatch
(
'/%[^%]+%|![^!]+!/'
,
$argument
);
if (!
$meta
&& !
$quote
) {
$quote
=
strpbrk
(
$argument
,
'^&|<>()'
) !==
false
;
}
if (
$quote
) {
src/Composer/Util/ProcessExecutor.php
composer/composer
if (
Platform
::
isWindows
()) {
$cmd
=
Preg
::
replaceCallback
(
"/('[^']*')/"
, function (
$m
) {
$char
= (
strpbrk
(
$m
[
1
],
" \t^&|<>()"
) !==
false
||
$m
[
1
] ===
"''"
) ?
'"'
:
''
;
return
str_replace
(
"'"
,
$char
,
$m
[
1
]);
},
$cmd
);
tests/Composer/Test/TestCase.php