Problem/Motivation

The constant is deprecated https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_leve...

Steps to reproduce

Example in Symfony https://github.com/symfony/symfony/pull/57799

Run grep -r -F "E_STRICT" core after 8.4.0RC1 release

Grep

Proposed resolution

Remove the usage as E_STRICT is a part of E_ALL since PHP 5.4.0

Remaining tasks

- create a patch and change record
- commit

User interface changes

no

Introduced terminology

no

API changes

no

Data model changes

no

Release notes snippet

Issue fork drupal-3465826

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andypost created an issue. See original summary.

arunkumark made their first commit to this issue’s fork.

arunkumark’s picture

Issue summary: View changes
StatusFileSize
new171.88 KB
new501.83 KB

As per the Stackoverflow discussion

E_ALL will show all level of error, E_STRICT introduced on PHP 5.0 will show suggestion/notice of strict coding standard/best practice. Since PHP 5.4 E_STRICT is been included in E_ALL.

So, a simple replacement of E_STRICT with E_ALL is enough to handle the deprecation.

Merged

Reference:
https://stackoverflow.com/questions/32930464/what-is-the-difference-betw...
https://stackoverflow.com/questions/1638238/whats-the-point-of-e-all-e-s...

andypost’s picture

Nice so only MR needed and update issue summary with proposed changes

arunkumark’s picture

Status: Active » Needs review
andypost’s picture

Looking back at SF changes, I thing we need to populate E_STRICT in drupal_error_levels() for PHP before 8.4

smustgrave’s picture

Status: Needs review » Needs work

For the check @andypost mentioned. Sounds like it couldn't hurt to have.

andypost’s picture

Status: Needs work » Needs review

I checked usage of drupal_error_levels() and it is mostly unused, so I think it does not need to add the deprecated and unused type

andypost’s picture

Issue summary: View changes

Added CR and updated IS, also removed comment as it useless now

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Removal didn't break anything so probably doesn't need a deprecation or anything. Looks good.

  • catch committed 1912151e on 11.x
    Issue #3465826 by arunkumark, andypost: Remove deprecated in PHP 8.4 the...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Had a think about whether the return type of drupal_error_levels() changing needed a CR. Modules do call it, but they only use it for the mapping, not referencing E_STRICT directly at all, so I think it's fine to just remove as 'dead code'.

Committed/pushed to 11.x, thanks!

andypost’s picture

Maybe we can backport it to 10.4.x?

andypost’s picture

It was finally commited so expect in RC1

andypost’s picture

Version: 11.x-dev » 10.4.x-dev
Status: Fixed » Reviewed & tested by the community

Needs backport

  • catch committed bf3ee6cd on 10.4.x
    Issue #3465826 by arunkumark, andypost: Remove deprecated in PHP 8.4 the...
andypost’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Thank you!

arunkumark’s picture

@andypost hope the backport for 10.4.x is done. I verified source code the changes are available in latest pull.

Status: Fixed » Closed (fixed)

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