emoncms icon indicating copy to clipboard operation
emoncms copied to clipboard

Required PHP version?

Open reedy opened this issue 3 years ago • 3 comments

xref #1811

It's unclear what version of PHP is actually needed... I see some code guarded with PHP 7.3 checks...

Seemingly at least 7.0... maybe?

reedy avatar Aug 17 '23 18:08 reedy

Can we get an answer on this?

If we're only "testing" on 7.4....

reedy avatar Jan 24 '26 16:01 reedy

CC @trystanlea-maker @TrystanLea

reedy avatar Jan 24 '26 17:01 reedy

Apologies @reedy, a code check suggests versions as old as 7.2 might still be compatible.

Syntax: every .php file passes php -l under PHP 7.4 and 8.0, using the official Docker images. So nothing uses syntax added in 8.0 or 8.1, such as match, ?->, named arguments, enums, readonly or never. PHPCompatibility 9.3.5, run through PHPCS against PHP 7.0 and later. The non-test findings were:

  • 7.1 syntax: ?string in four admin models, : void in core.php:617, and [$a, $b] = ... in SystemInfoModel.php:598.
  • A 7.2 constant: JSON_INVALID_UTF8_SUBSTITUTE in dashboard_convert.php:1779 and export_content.php:97.
  • A 7.3 constant: PASSWORD_ARGON2ID in password.php:96. It's already guarded by defined(), and bcrypt is the default, so it isn't a requirement.
  • PHP 8.0+ functions: that PHPCompatibility release can't see these, so I grepped instead. There are no uses of str_contains, str_starts_with, array_is_list, json_validate and similar.

TrystanLea avatar Oct 05 '26 20:10 TrystanLea