Make exit() unwind properly (minimal version) by nikic · Pull Request #5768 · php/php-src

@nikic

@nikic mentioned this pull request

Jun 25, 2020

jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request

Aug 9, 2020
…estructAfterConstructorExit` sniff

> If an object constructor exit()s, the object destructor will no longer be
> called. This matches the behavior when the constructor throws.

Notes:
* This sniff will throw an error, even when there is no destructor as a destructor may be declared in a parent class.
    We could reduce the potential noise from this sniff a little further by only throwing the error when the class either contains a `__destruct()` method or extends a parent class.
* The name for the sniff feels a bit long. Suggestions for a better/shorter name welcome.

Opinions ?

Refs:
* https://github.com/php/php-src/blob/71bfa5344ab207072f4cd25745d7023096338385/UPGRADING#L200-L201
* php/php-src#5768 (I suspect, but not 100% sure)
* php/php-src@75a04ea

jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request

Aug 10, 2020
…estructAfterConstructorExit` sniff

> If an object constructor exit()s, the object destructor will no longer be
> called. This matches the behavior when the constructor throws.

Notes:
* This sniff will throw an error, even when there is no destructor as a destructor may be declared in a parent class.
    We could reduce the potential noise from this sniff a little further by only throwing the error when the class either contains a `__destruct()` method or extends a parent class.
* The name for the sniff feels a bit long. Suggestions for a better/shorter name welcome.

Opinions ?

Refs:
* https://github.com/php/php-src/blob/71bfa5344ab207072f4cd25745d7023096338385/UPGRADING#L200-L201
* php/php-src#5768 (I suspect, but not 100% sure)
* php/php-src@75a04ea

@jrfnl jrfnl mentioned this pull request

Aug 10, 2020