vimeo/psalm

`str_replace()` with more search then replace values

Open

#4253 aperta il 28 set 2020

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)PHP (668 fork)batch import
Help wantedenhancementtype providers

Metriche repository

Star
 (5369 star)
Metriche merge PR
 (Merge medio 3g 12h) (5 PR mergiate in 30 g)

Descrizione

even if it is supported by php-src, I think it should be an error (or at least warning) when using str_replace with less replace args, then search args. its most likely a typo and the default behaviour of php-src assuming we want to replace with an empty string is not obvious.

I expect an error, telling me that the number of replace args is not equal with the number of search args in https://psalm.dev/r/7385fe7881

Guida contributor