Skip to content

PHP 8.0 | RemovedNamespacedAssert: adjust for removal in PHP 8.0#1281

Merged
wimg merged 1 commit intodevelopfrom
php-8.0/removednamespacedassert-upgrade-to-error
Apr 17, 2021
Merged

PHP 8.0 | RemovedNamespacedAssert: adjust for removal in PHP 8.0#1281
wimg merged 1 commit intodevelopfrom
php-8.0/removednamespacedassert-upgrade-to-error

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Apr 11, 2021

Declaring a function called assert() inside a namespace is no longer allowed, and issues E_COMPILE_ERROR. The assert() function is subject to special handling by the engine, which may lead to inconsistent behavior when defining a namespaced function with the same name.

Ref: https://www.php.net/manual/en/migration80.incompatible.php

This adjusts the existing sniff to take the change to fatal error in PHP 8.0 into account.

Note: the error code of the sniff has been changed! This is a minor breaking change and should be annotated in the changelog.

Related to #809

@jrfnl jrfnl added Type: enhancement PR: quick merge PR only contains relatively simple changes PR: ready for review labels Apr 11, 2021
@jrfnl jrfnl added this to the 10.0.0 milestone Apr 11, 2021
@jrfnl jrfnl requested a review from wimg April 11, 2021 08:51
> Declaring a function called `assert()` inside a namespace is no longer allowed, and issues `E_COMPILE_ERROR`. The `assert()` function is subject to special handling by the engine, which may lead to inconsistent behavior when defining a namespaced function with the same name.

Ref: https://www.php.net/manual/en/migration80.incompatible.php

This adjusts the existing sniff to take the change to fatal error in PHP 8.0 into account.

Note: the error code of the sniff has been changed! This is a minor breaking change and should be annotated in the changelog.
@jrfnl jrfnl force-pushed the php-8.0/removednamespacedassert-upgrade-to-error branch from 380abbd to 6ef5d13 Compare April 11, 2021 08:52
@wimg wimg merged commit a1b7af9 into develop Apr 17, 2021
@wimg wimg deleted the php-8.0/removednamespacedassert-upgrade-to-error branch April 17, 2021 15:18
@jrfnl jrfnl removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Apr 17, 2021
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