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

Fixes to deprecation warnings starting in PHP 8.2 #248

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

neapsix
Copy link

@neapsix neapsix commented Jun 6, 2023

Hello! Another patch for you to consider. This PR updates a few lines that still work but cause deprecation warnings starting in PHP 8.2.

The first commit replaces ${var} with {$var}. The second uses an iterator instead of calling reset() on an object. I've validated them on FreeBSD with Apache and PHP 8.0, 8.1, and 8.2.

I followed the guidance in the deprecation notices but don't have much experience with PHP—happy to change or rework based on your feedback. Thank you so much!

I agree to release this contribution under the Mozilla Public License 2.0.

Using `${var}` to embed variables in strings causes warnings starting
in PHP 8.2. This commit replaces two instances with `{$var}`, following
recommendations in the deprecation notice and related RFC.
Calling `reset()` on an object causes warnings starting in PHP 8.2.
This commit replaces one instance with ArrayIterator object and
getIterator() method following a recommendation in the deprecation
notice RFC.
@neapsix neapsix changed the title Patch php82 2 Fixes to deprecation warnings starting in PHP 8.2 Jun 6, 2023
@neapsix neapsix marked this pull request as ready for review June 6, 2023 03:55
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

Successfully merging this pull request may close these issues.

None yet

1 participant