Skip to content

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 15, 2024

PHP 8.4 | Collections::functionCallTokens(): add T_EXIT

As of PHP 8.4, exit and die will become "special" function calls and when used as a constant, it will be transformed to a function call at compile time. See the RFC for full details.

With this in mind, it is appropriate to add T_EXIT to the functionCallTokens() and by inheritance to the parameterPassingTokens().

Includes unit tests.

Ref: https://wiki.php.net/rfc/exit-as-function

PassedParameters: minor update for support of exit

As the Collections::parameterPassingTokens() array now contains T_EXIT, exit and die will now also be analyzable via the methods in the PassedParameters class.

This commit:

  • Updates the documentation and the exception message to reflect this.
  • Adds various tests with exit and die.

jrfnl added 2 commits August 13, 2024 20:35
As of PHP 8.4, `exit` and `die` will become "special" function calls and when used as a constant, it will be transformed to a function call at compile time. See the RFC for full details.

With this in mind, it is appropriate to add `T_EXIT` to the `functionCallTokens()` and by inheritance to the `parameterPassingTokens()`.

Includes unit tests.

Ref: https://wiki.php.net/rfc/exit-as-function
As the `Collections::parameterPassingTokens()` array now contains `T_EXIT`, `exit` and `die` will now also be analyzable via the methods in the `PassedParameters` class.

This commit:
* Updates the documentation and the exception message to reflect this.
* Adds various tests with `exit` and `die`.
@jrfnl jrfnl added this to the 1.1.0 milestone Aug 15, 2024
@jrfnl jrfnl merged commit 16645d7 into develop Aug 18, 2024
54 checks passed
@jrfnl jrfnl deleted the php-8.4/update-for-exit-as-function-call branch August 18, 2024 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant