Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.4 - Implicit nullability deprecation #442

Closed
Ayesh opened this issue Mar 18, 2024 · 6 comments
Closed

PHP 8.4 - Implicit nullability deprecation #442

Ayesh opened this issue Mar 18, 2024 · 6 comments

Comments

@Ayesh
Copy link
Contributor

Ayesh commented Mar 18, 2024

PHP 8.4 recently merged changes to emit a deprecation notice on function declared with an implicit nullable type.

All upstream functions in php-src already have the nullable types (?string $var = null and not string $var = null), so we will need to update our generator to account for this.

I submitted PR #441 to preview the expected changes.

@sebastianbergmann
Copy link

This library is used by @theofidry's php-scoper tool which is used in the release process of PHPUnit.

When I use php-scoper with PHP 8.4 then I get

PHP Fatal error:  Uncaught ErrorException: _HumbugBoxf238c5c0abfa\Safe\gmdate(): Implicitly marking parameter $timestamp as nullable is deprecated, the explicit nullable type must be used instead in phar:///usr/local/src/phpunit/tools/php-scoper/vendor/thecodingmachine/safe/deprecated/datetime.php:6

There must be an error handler, either in this library or in php-scoper, that escalates the deprecation to a fatal error.

TL;DR: As of right, I cannot release new versions of PHPUnit using PHP 8.4 due to this library not being compatible with PHP 8.4.

@staabm
Copy link
Collaborator

staabm commented Nov 28, 2024

@sebastianbergmann @theofidry looking at thecodingmachine/safe repo I can't see a error handler.

since PHPUnit got new releases I guess this problem got somehow fixed for you?

@staabm
Copy link
Collaborator

staabm commented Nov 28, 2024

the OPs problem got fixed by

@staabm staabm closed this as completed Nov 28, 2024
@sebastianbergmann
Copy link

since PHPUnit got new releases I guess this problem got somehow fixed for you?

I downgraded PHP to roll the release of PHPUnit 11.4.4.

@jhdxr
Copy link

jhdxr commented Dec 13, 2024

the OPs problem got fixed by

* [f87af02](https://github.com/thecodingmachine/safe/commit/f87af02c112e4afdc42ee002e3ce86531df70ab5)

* [8a6679c](https://github.com/thecodingmachine/safe/commit/8a6679c47aaee74d3d90fe27df0c544335db019e)

Hi @staabm is there any chance that you have a plan to publish a release to include these changes? Last release is over one year ago.

@staabm
Copy link
Collaborator

staabm commented Dec 13, 2024

We discuss it in #499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants