Skip to content

Commit 277d590

Browse files
authored
Make Stringable::swap() match Str::swap() implementation (#40855)
Both call function strtr().
1 parent b04ab8a commit 277d590

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Support/Stringable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ public function substrReplace($replace, $offset = 0, $length = null)
741741
*/
742742
public function swap(array $map)
743743
{
744-
return new static(str_replace(array_keys($map), array_values($map), $this->value));
744+
return new static(strtr($this->value, $map));
745745
}
746746

747747
/**

0 commit comments

Comments
 (0)