phplaravelvisual-studio-codephpmyadminxampp

I tried to open my Laravel application which was developed 2yrs ago and when I register a user I see the following error


Trying to access array offset on value of type null

if ($previous['type'] === EmailLexer::S_BACKSLASH

Solution

  • The error states that the variable $previous, which you expect to be an array, is actually null. You can't use an array offset on a null. Given that you said it was developed 2 years ago, probably some library changed and has different return types. Check where you instantiate $previous or how it is assigned a value.