php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80872 TypeError: str_replace(): Argument #2 ($replace) must be of type array|string,
Submitted: 2021-03-16 11:02 UTC Modified: 2021-03-16 11:03 UTC
From: fgfgfg dot hjhjhjhj at ghghgh dot fg Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 8.0.3 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fgfgfg dot hjhjhjhj at ghghgh dot fg
New email:
PHP Version: OS:

 

 [2021-03-16 11:02 UTC] fgfgfg dot hjhjhjhj at ghghgh dot fg
Description:
------------
while i *fully* support the intention it's a no-go that automated tests running with 7.2-7.4 don't throw any warning or notice and 8.0 leads to an exception

that will be a bresking change in production instead while running 7.4 over months you just add (string) in front and you are done (example: value is coming from a database instead a form-submit and so is 'int' instead 'string' which is they case here)

TypeError: str_replace(): Argument #2 ($replace) must be of type array|string, int given


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-16 11:03 UTC] nikic@php.net
-Status: Open +Status: Wont fix
 [2021-03-16 11:09 UTC] fgfgfg dot hjhjhjhj at ghghgh dot fg
and why won't you fix it?

it's completly uncommon introducing breaking changes of that category without any warning in the version before and it don't speed up moving the world to php8
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 23:01:33 2025 UTC