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.