Page MenuHomePhorge

Remove use of deprecated E_STRICT PHP constant
Needs ReviewPublic

Authored by aklapper on Feb 17 2025, 11:49.

Details

Summary

The E_STRICT PHP constant is deprecated since PHP 8.4 per https://www.php.net/manual/en/migration84.deprecated.php.
Per https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant, the E_STRICT constant was still in use in-between PHP 7.0 and 7.4 for PHP's mysqli extension and PHP's htmlentities() function.

The E_STRICT notice was removed from PHP's mysqli extension in https://github.com/php/php-src/commit/e895e962867123aff6ea703ff41670b7eb5c47f1 for PHP 7.4.0.
Since rP23a49eb403c9ea6c58f4ae2f22416e90a9d24c14, Phorge requires 7.2.25.
Phorge does not call PHP's htmlentities() function.

E_STRICT is a part of E_ALL since PHP 5.4.0 per https://github.com/php/php-src/blob/php-5.4.0/NEWS#L69, thus there is no gain in keeping it.

Closes T15989

Test Plan

None.

Diff Detail

Repository
rP Phorge
Branch
T15989 (branched from master)
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1725
Build 1725: arc lint + arc unit

Event Timeline

Phorge neither uses PHP's mysqli extension nor calls PHP's htmlentities() function.

Are you sure about that? Phorge supports either the old mysql extension or mysqli - and mysql was deprecated in PHP 5.5, and removed in PHP 7.0. Notably, Phorge checks for the existence of mysqli in PhabricatorDatabaseRef, PhabricatorExtensionSetupCheck and PhabricatorPHPConfigSetupCheck.

Yeah I was also pretty sure Phab used mysqli? I have had to have it on all my installations, and the Phorge documentation still cites it. https://we.phorge.it/book/contrib/article/database/

Though for the scope of the concern here that shouldn't matter, as per the quoted details the mysqli extension was only using E_STRICT between a range of PHP versions now in the rearview mirror, the removal of it was approved and merged at the end of August 2019, so continued use of the mysqli extension won't trip Phorge up for this deprecation.

I cannot remember how I attempted (and failed) to check a few weeks ago... Thank you both for jumping in and correcting!

Phorge supports either the old mysql extension or mysqli - and mysql was deprecated in PHP 5.5, and removed in PHP 7.0.

That sounds like technical debt to remove so I filed T16024