Jump to content

How to prevent this PHP8 error on PHP7.4 systems?


bernhard
 Share

Recommended Posts

The latest version of RockMigrations (and many other of my modules) require PHP8.0 as minimum version. PHP7.4 is end of life, so everybody should update anyhow. But I'd be interested if there is a better solution to the following problem:

When on a PHP7.4 system and you install (or try to install) RockMigrations you'll end up with an error like this:

MKYVHjE.png

The module has PHP>=8.0 in its requires array, but it can not check for that dependency because PHP complains before even executing the check.

That means the modules backend is unusable until you remove the module manually and/or update your PHP version.

Any ideas?

Link to comment
Share on other sites

1 hour ago, Rudy said:

How about writing your ternary like this?

Thx @Rudy but the error comes from the first colon that comes from PHP8's named arguments 

1 hour ago, BitPoet said:

That's what ModuleName.info.php was designed for. PW can check dependencies without loading the full module.

Ah! Thx about that reminder. I got used to writing everything into the .module.php file as I saw no benefit in having a separate file, but that totally makes sense 🙂 Thx!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...