skiedude/evestructures

PHP7.4 support

Closed this issue · 0 comments

Hey Brock,

I'm aware this project is now in 'limited updates' mode but I figured it'd be good to open this issue to ensure the project can (hopefully) remain future-proof.

When using PHP7.4 we're running into this error:

2020-05-23 03:18:06] laravel.ERROR: Trying to access array offset on value of type null {"exception":"[object] (ErrorException(code: 0): Trying to access array offset on value of type null at /var/www/bleh/app/Http/Controllers/WelcomeController.php:12)

As you correctly pointed out it's due to how PHP7.4 handles null values:

 $alert = $alert[0];

I tested with your suggested fix but no luck unfortunately, replacing the above with:

$alert = len($alert) > 0 ? $alert[0] : null;

If you need any further information I'm happy to switch PHP versions and report back with whatever you need. Thanks again for this awesome tool!