#99184ValueException in GeneralUtility intExplode/trimExplode
Description
Hi,
If you call GeneralUtility::intExplode() or GeneralUtility::trimExplode() with an empty string as delimiter a ValueException will be thrown since PHP 8.0.
Maybe such calls should be wrapped in a try-catch block?
Stefan
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 4
-
Stefan Froemken changed Related to #99178 11/24/22, 15:28
-
Stefan Froemken commented 11/24/22, 15:29
-
Georg Ringer commented and changed status
NewNeeds Feedback 01/12/23, 11:31Thanks for creating this issue. TBH I would close this issue and don’t change anything – this will help the developers to find the issue and solve it. what should happen in the catch block?
-
Stefan Froemken commented and changed status
Needs FeedbackClosed 01/12/23, 12:33Hi Georg,
sorry. Don’t remember anymore in which case I need that.
In glossary2 I had a ABCDE-list and want to convert them into an [A, B, C, D, E] array. Currently I have solved it with str_split
In jwtools2 I want to split content somehow. Currently solved with preg_match.
So, no need to investigate more time here, as I have found alternative solutions
Stefan
See ChangeLog of PHP 8.0: https://www.php.net/manual/de/function.explode.php