$pwd = $keyfile;
$pwd_length = strlen($pwd);
for ($i = 0; $i < 255; $i++) {
$key[$i] = ord(substr($pwd, ($i % $pwd_length)+1, 1));
It is saying that you are calling the function with $keyfile as an empty string, so $pwd is empty, so $pwd_length is 0, so
$i % $pwd_length is...