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
558558 */
559559 public function trimPrefix ($ prefix ): static
560560 {
561- if (is_iterable ($ prefix )) {
561+ if (\is_array ($ prefix ) || $ prefix instanceof \Traversable ) { // don't use is_iterable(), it's slow
562562 foreach ($ prefix as $ s ) {
563563 $ t = $ this ->trimPrefix ($ s );
564564
@@ -592,7 +592,7 @@ abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FE
592592 */
593593 public function trimSuffix ($ suffix ): static
594594 {
595- if (is_iterable ($ suffix )) {
595+ if (\is_array ($ suffix ) || $ suffix instanceof \Traversable ) { // don't use is_iterable(), it's slow
596596 foreach ($ suffix as $ s ) {
597597 $ t = $ this ->trimSuffix ($ s );
598598
You can’t perform that action at this time.
0 commit comments