Skip to content

PHP 8.1 | RemovedConstants: account for PHP 8.1 changes#1319

Merged
wimg merged 5 commits intodevelopfrom
php-8.1/removedconstants-account-for-php-8.1-changes
Mar 9, 2022
Merged

PHP 8.1 | RemovedConstants: account for PHP 8.1 changes#1319
wimg merged 5 commits intodevelopfrom
php-8.1/removedconstants-account-for-php-8.1-changes

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Mar 9, 2022

PHP 8.1 | RemovedConstants: handle deprecated FILE_* constants

The FILE_BINARY and FILE_TEXT constants have been deprecated. They never had any effect.

Includes unit tests.

Refs:

PHP 8.1 | RemovedConstants: handle deprecated FILTER_* constants

The FILTER_SANITIZE_STRING and FILTER_SANITIZE_STRIPPED filters are deprecated.

Includes unit tests.

Refs:

PHP 8.1 | RemovedConstants: handle deprecated NIL constant

The NIL constant has been deprecated. Use 0 instead.

Includes unit tests.

Refs:

PHP 8.1 | RemovedConstants: handle deprecated MySqli constants

Not mentioned anywhere in the changelogs or migration guide. Still happened.

Includes unit tests.

Refs:

PHP 8.1 | RemovedConstants: handle (soft) deprecated MySqli constants

  • The MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH option no longer has an effect.
  • The MYSQLI_STORE_RESULT_COPY_DATA option no longer has an effect.

While these constants aren't formally deprecated, they no longer have any effect, so they are effectively (soft) deprecated.

As this isn't a formal category, I'd like to suggest to treat them for the purpose of PHPCompatibility as deprecated.
Alternatively, we could add a new notice to the sniff for non-deprecated constants, which no longer have any effect.

Includes unit tests.

Refs:

Related to #1299

jrfnl added 5 commits March 9, 2022 01:01
Not mentioned anywhere in the changelogs or migration guide. Still happened.

Includes unit tests.

Refs:
* php/php-src#6850
* php/php-src@b7a298b
> * The `MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH` option no longer has an effect.
> * The `MYSQLI_STORE_RESULT_COPY_DATA` option no longer has an effect.

While these constants aren't formally deprecated, they no longer have any effect, so they are _effectively_ (soft) deprecated.

As this isn't a formal category, I'd like to suggest to treat them for the purpose of PHPCompatibility as deprecated.
Alternatively, we could add a new notice to the sniff for non-deprecated constants, which no longer have any effect.

Includes unit tests.

Refs:
* https://github.com/php/php-src/blob/f67986a9218f4889d9352a87c29337a5b6eaa4bd/UPGRADING#L99-L100
* php/php-src@890e4ca
* php/php-src@33e9049
@jrfnl jrfnl added Type: enhancement PR: quick merge PR only contains relatively simple changes PR: ready for review labels Mar 9, 2022
@jrfnl jrfnl added this to the 10.0.0 milestone Mar 9, 2022
@jrfnl jrfnl requested a review from wimg March 9, 2022 00:36
@wimg wimg merged commit 9a47115 into develop Mar 9, 2022
@wimg wimg deleted the php-8.1/removedconstants-account-for-php-8.1-changes branch March 9, 2022 12:15
@jrfnl jrfnl removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants