You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PHP 8 empty strings are present in every string. This means that depending on which version of PHP you're using, assertions like assertContains and assertNotContains can behave different.
This may not be a bug, but because it will always pass (or fail) it does not seem like the intended functionality. Also personally it seems like passing an empty string to these assertions means something went wrong in the code calling the assertion and its more useful result is to fail then to treat it as passing.
The text was updated successfully, but these errors were encountered:
In PHP 8 empty strings are present in every string. This means that depending on which version of PHP you're using, assertions like assertContains and assertNotContains can behave different.
I thought this was a bug but it seems to be an intentional but fairly undocumented change in PHP8
https://3v4l.org/VGB5j
https://php.watch/versions/8.0/string-function-empty-needles
This may not be a bug, but because it will always pass (or fail) it does not seem like the intended functionality. Also personally it seems like passing an empty string to these assertions means something went wrong in the code calling the assertion and its more useful result is to fail then to treat it as passing.
The text was updated successfully, but these errors were encountered: