Skip to content

[2.1] Using E_USER_ERROR in trigger_error() deprecated in PHP 8.4 #9141

Description

@sbulen

Basic Information

E_USER_ERROR is passed to trigger_error(), indirectly, in the DB routines when preparing a backtrace. There may be other instances.

Source: https://www.php.net/manual/en/migration84.deprecated.php

See:

smf_db_error_backtrace('Wrong value type sent to the database. IPv4 or IPv6 expected.(' . $matches[2] . ')', '', E_USER_ERROR, __FILE__, __LINE__);

trigger_error($error_message . ($line !== null ? '<em>(' . basename($file) . '-' . $line . ')</em>' : ''), $error_type);

I have learned a few lessons testing #9126 that I will log separately. Pretty sure these affect both 2.1 & 3.0.

Steps to reproduce

Expected result

No response

Actual result

No response

Version/Git revision

2.1 & 3.0 Alpha 4

Database Engine

All

Database Version

No response

PHP Version

8.4

Logs

Additional Information

No response

Activity

  1. jdarwood007 commented on Mar 12, 2026

    @jdarwood007
    Member

    Only difficult part is, throwing for 2.1 may require a lot of rework. Whereas in 3.0 we can handle this (if we didn't already)

  2. added theissue type on Mar 12, 2026
  3. added this to the 2.1.8 milestone on Mar 12, 2026
  4. Sesquipedalian commented on Mar 12, 2026

    @Sesquipedalian
    Member

    (if we didn't already)

    We did

  5. sbulen commented on Mar 12, 2026

    @sbulen
    ContributorAuthor

    I was thinking we could just return 406 or 500 instead in 2.1...

  6. jdarwood007 commented on Mar 12, 2026

    @jdarwood007
    Member

    Great, so 3.0 doesn't need fixed.

    That leads me to believe that we are in a difficult spot here. The error is most likely being thrown so it can be caught by another error handler, prior to it being caught by the normal error handler. I think such cases are out of the box where the upgrader.
    We may be able to change to E_USER_WARNING, but it's possible that anything checking for it to be strictly E_USER_ERROR would fail.

  7. modified the milestones: 2.1.8, 2.1.9 on Jul 25, 2026
  8. changed the title [-][2.1 & 3.0] Using E_USER_ERROR in trigger_error() deprecated in PHP 8.4[/-] [+][2.1] Using E_USER_ERROR in trigger_error() deprecated in PHP 8.4[/+] on Oct 24, 2026
  9. jdarwood007 commented on Oct 24, 2026

    @jdarwood007
    Member

    This only affects 2.1 since we already switched over to exceptions for 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions