Deprecated: str_replace(): Passing null to parameter #2

good day, greetings community.
I am writing to you so that you can guide me a little with the following error message that is generated in my local environment with cakephp 3.8 and I have no idea what it refers to, set my debug to false and I can work but the error is still there solve.

Deprecated : str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in C:\xampp\htdocs\proyectos\kippgo_admin\vendor\cakephp\cakephp\src\Utility\Text.php on line 233

I thank you for your collaboration in advance

Are you using the Text Utility class somewhere?
That error is inside the Text::insert() method.

yes, but by default in cakephp

well sure, the method triggering the deprecation message is inside cakephp but it is caused by something outside.
You need to look at the callstack in e.g. your logs/debug.log to see from where the call has come from and then we can help you more. The info you are providing is just not enough to tell you “Do X, then its fixed”

the error occurs in this line of code:

$str = str_replace($tmpHash, $tmpValue, $str); 

Here is a more complete code snippet:

$dataReplacements = array_combine($hashKeys, array_values($data));
        foreach ($dataReplacements as $tmpHash => $tmpValue) {
            $tmpValue = is_array($tmpValue) ? '' : $tmpValue;
            $str = str_replace($tmpHash, $tmpValue, $str);
        }

I know what the code lines are, they are easily accessible on github.

But there is nothing wrong with that codepart, its the data passed into the utility class which causes that error.
And to find that you need to tell us the callstack as mentioned above.

Good morning guys, I summarize a little what happened in my case.
After reading a bit and reviewing my work environment, I realized that it is working with php version 8 and cakephp 3.8, so the php version conflicted with the cakephp version.
When changing the version of php (in this case 7.4) the error stopped appearing.
As I needed to resolve some urgent issues, I set the debug to false in my app.php, and continued working, after being a little free, I returned the debug to true and started trying to resolve the issue with that error.
Thank you very much for your time and response, I apologize for the time it took me to answer here again. Thank you. @KevinPfeifer

For anyone else who is encountering this issue: You can try to manually adjust your
vendor\cakephp\cakephp\src\Utility\Text.php line 233
from

$str = str_replace($tmpHash, $tmpValue, $str);

to

$str = str_replace($tmpHash, $tmpValue ?? '', $str);

to get rid of this internal error and see the actual error message from your app which needs to be fixed.

But after that make sure to revert that change in the vendor folder.