php-qrcode icon indicating copy to clipboard operation
php-qrcode copied to clipboard

PHP 8.4 deprecation of implicit nullable

Open campbell-m opened this issue 1 year ago • 6 comments
trafficstars

Running QRCode against PHP 8.4.0alpha1 gives a number of E_DEPRECATED error messages, eg

E_DEPRECATED in C:\inetpub\wwwroot\abcd\lib\chillerlan\QRCode\QRCode.php at line 80
chillerlan\QRCode\QRCode::render(): Implicitly marking parameter $data as nullable is deprecated, the explicit nullable type must be used instead

campbell-m avatar Jul 15 '24 16:07 campbell-m

Hey, I am aware of this issue (https://wiki.php.net/rfc/deprecate-implicitly-nullable-types). PHP 8.4 is a couple more months down the road, implicit nullables will be fixed until then.

codemasher avatar Jul 15 '24 16:07 codemasher

OK, thanks.

campbell-m avatar Jul 15 '24 16:07 campbell-m

Just as a heads-up, this is what currently happens when I enable PHP 8.4 on CI: https://github.com/chillerlan/php-settings-container/actions/runs/9947535033/job/27480365765 (spoiler: countless warnings from dev-dependencies)

codemasher avatar Jul 15 '24 22:07 codemasher

@campbell-m I've pushed a fix to address this issue to the v4 and v5 as well as dev-main (upcoming v6) branches. Can you perhaps check if this resolves the issue for you?

The composer tags are:

  • dev-main#f65d9d2815b4362fde0cac18205ca7b711692a8c f65d9d2815b4362fde0cac18205ca7b711692a8c
  • v5.0.x-dev#beecbe7ba5f4776bd8bd7e69d84d0c7dc8a94983 beecbe7ba5f4776bd8bd7e69d84d0c7dc8a94983
  • v4.3.x-dev#f6c4da9ce405b5a7815c8d882b3d85c5514f6f1d f6c4da9ce405b5a7815c8d882b3d85c5514f6f1d

codemasher avatar Jul 17 '24 09:07 codemasher

Many thanks. That seems to fix the issues.

campbell-m avatar Jul 17 '24 12:07 campbell-m

I'm going to reopen this as this is probably not done yet. It's still not possible to run tests on CI under PHP 8.4 as dependencies will cause trouble.

codemasher avatar Jul 17 '24 19:07 codemasher

PHP 8.4 GA release is next week - if anything explodes in the meantime it's not my fault... 🤞

codemasher avatar Nov 15 '24 18:11 codemasher