TypeError thrown

mb_substr(): Argument #3 ($length) must be of type ?int, string given