PHP's each() function has been deprecated since 7.2. Not clear when it will be removed completely. It can be removed and replaced with some alternative methods to do the same thing which are compatible with PHP 7.2+ and PHP 5.2+.

Comments

bkosborne created an issue. See original summary.

bharath-kondeti’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

Please review the patch uploaded.

Thanks

emartoni’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +#ciandt-contrib
StatusFileSize
new22.5 KB
new118 KB

Patch works for me!

Thanks!

wundo’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -#ciandt-contrib

Tests are failing.

jacob.embree’s picture

Status: Needs work » Postponed

The tests are failing because of a deprecated each() in includes/module.inc. This issue is blocked by #2925449: [PHP 7] Function each() is deprecated since PHP 7.2 [D7].

jacob.embree’s picture

The patch even works on PHP 7.1, so I think#2 can be commited. Clearly, the failed test is due to Drupal 7's includes/module.inc, not any fault in #2.

mrgoodfellow’s picture

Patch appears to be working successful for me. Will this get merged with the main branch and pushed out in an update soon for PHP 7.2 compatibility?

wundo’s picture

Status: Postponed » Needs review

Patch looks good, I'm re-queueing for tests now that 8.x-1.x is passing in php 5.*

wundo’s picture

wundo’s picture

StatusFileSize
new1.32 KB

wundo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mrgoodfellow’s picture

This seems to be working. As the Drupal 7.61 puts core into PHP 7.2 compatibility, is there any timeline for when this patch will be bundled with a new release?

hossein425’s picture

Issue tags: +PHP 8.1

A new release is expected, since 4 years ago.

alina.basarabeanu’s picture

Patch #10 works on Drupal core 7.92, PHP 8.0.21 and SMTP 7.x-1.7 version.
I also needed 2 more patches to fix all the PHP 8 errors/warnings: remove deprecated directive 3050130 and remove deprecated code 3009090.
Is there any chance to get all those merged into dev or a new stable release for Drupal 7?

thor10’s picture

Is there any chance to get all those merged into dev or a new stable release for Drupal 7?

That would be great if there was an update to be usable on PHP 8.0/8.1 as well.

joseph.olstad’s picture

I contacted the maintainer about this and wrote the following:

Hello @japerry, for the smtp module https://www.drupal.org/project/smtp someone today installed the latest tagged release and was unable to use current releases of PHP with the smtp module, little did they know that the issue was fixed in dev two years ago however no one has tagged a release. The fix has been in dev for 2 years, we just need a tag.

To avoid this issue going forward, please tag a release for smtp 7.x-1.8 based on the current 7.x-1.x dev.

See related issues:

https://www.drupal.org/project/smtp/issues/2946667

and

https://www.drupal.org/project/drupal/issues/3224299#comment-14859727

Thank you,

joseph.olstad

japerry’s picture

My appologies, my focus has been on the d8+ versions of SMTP. The 7.x-1.8 release has been made and should fix these issues. Thanks Joseph for letting me know.

poker10’s picture

Great, thanks @japerry and @joseph.olstad!