I had that error too. With that error it produced also a stack trace:
Fatal error: Uncaught ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) in proc.php:963
Stack trace:
#0 proc.php(963): strpos('', '`', -1)
#1 {main}
thrown in proc.php on line 963
As you see it tells that the first argument (a variable in the code) had evaluated to an empty string and the negative offset 1 in that empty string was not allowed. So it looks like you will always have to use a strlen check if this kind of situation can happen.
BTW: strrpos is not a solution. If you replace the above code with "strrpos('', '`', 1)" you get the same error.