Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ErrorException Trying to access array offset on value of type null [closed]

Tags:

php

I moved my laravel application to a new hosting account and I have been getting this error since then

ErrorException Trying to access array offset on value of type null

The email validator bro I guess.

I don't know if anyone has experience this kind of issue after moving a laravel website.

Please help!

like image 293
Tech Studeo Avatar asked Nov 13 '19 06:11

Tech Studeo


People also ask

What does it mean Trying to access array offset on value of type null?

It means that you tried to access an array using a NULL as an index. You can't do that. It has to be a positive number 0 (zero) and above but not higher than the size of the array. Remember that arrays start at 0 (zero) not 1.

What is array offset in PHP?

It means you're referring to an array key that doesn't exist. "Offset" refers to the integer key of a numeric array, and "index" refers to the string key of an associative array.


1 Answers

The PHP Version is indeed the problem. On the previous host it was PHP 7.3 but the new one run 7.4 so it caused the problem.

Now I have downgraded to PHP 7.3.1 and the application now works fine.

Thanks so much.

like image 195
Tech Studeo Avatar answered Oct 06 '22 00:10

Tech Studeo