The usage of strcspn slightly changed in PHP 8.0 alpha 1, which now checks, that the lenght parameter does not exceed the length of the string to search in. This was changed in php with this commit:
https://github.com/php/php-src/commit/5d9ab53a5d53f11a18ae11ed31b17ff87c8d52a7
Occurrences where the length parameter can exceed the length of the first argument:
ValueError: strcspn(): Argument #4 ($length) must be contained in argument #1 ($str) in /code/w/includes/resourceloader/ResourceLoader.php:1899
ValueError from line 474 of /code/w/includes/parser/Preprocessor_Hash.php: strspn(): Argument #4 ($length) must be contained in argument #1 ($str)