From e223fdfd43efeb447306457be5271babe136a2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20M=C3=BCller?= Date: Wed, 13 Aug 2025 14:13:47 +0200 Subject: [PATCH] Improve `str_replace` return type --- stubs/core.stub | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/core.stub b/stubs/core.stub index 6456c2d1b9..c8d94cf3bd 100644 --- a/stubs/core.stub +++ b/stubs/core.stub @@ -256,7 +256,7 @@ function preg_filter($pattern, $replacement, $subject, int $limit = -1, &$count * @param array|string $replace * @param array|string $subject * @param-out int $count - * @return list|string + * @return ($subject is array ? list : string) */ function str_replace($search, $replace, $subject, ?int &$count = null) {} @@ -265,7 +265,7 @@ function str_replace($search, $replace, $subject, ?int &$count = null) {} * @param array|string $replace * @param array|string $subject * @param-out int $count - * @return list|string + * @return ($subject is array ? list : string) */ function str_ireplace($search, $replace, $subject, ?int &$count = null) {}