File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -558,7 +558,7 @@ abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF
558
558
*/
559
559
public function trimPrefix ($ prefix ): static
560
560
{
561
- if (is_iterable ($ prefix )) {
561
+ if (\is_array ($ prefix ) || $ prefix instanceof \Traversable ) { // don't use is_iterable(), it's slow
562
562
foreach ($ prefix as $ s ) {
563
563
$ t = $ this ->trimPrefix ($ s );
564
564
@@ -592,7 +592,7 @@ abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FE
592
592
*/
593
593
public function trimSuffix ($ suffix ): static
594
594
{
595
- if (is_iterable ($ suffix )) {
595
+ if (\is_array ($ suffix ) || $ suffix instanceof \Traversable ) { // don't use is_iterable(), it's slow
596
596
foreach ($ suffix as $ s ) {
597
597
$ t = $ this ->trimSuffix ($ s );
598
598
You can’t perform that action at this time.
0 commit comments