Skip to content

E_STRICT constant is deprecated in PHP >=8.4, causes excessive logging in PHP error_log #16945

@shokupanjamin

Description

@shokupanjamin

Bug report

Summary

E_STRICT constant is deprecated in PHP >=8.4.
modErrorHandler causes excessive logging of deprecation notices in PHP error_log file.

Step to reproduce

Running MODX 2.8.8-pl on PHP>=8.4.

Observed behavior

PHP Error Log is excessively filled with Deprecation notices:
PHP Deprecated: Constant E_STRICT is deprecated in /path/to/modx/core/model/modx/error/moderrorhandler.class.php on line 95

Expected behavior

Deprecation notices should be avoided.

Environment

MODX version 2.8.8-pl
PHP version 8.4

Workaround / Fix

Workaround / Fix is potentially to comment out or remove the following switch case from moderrorhandler.class.php at line 95:

case E_STRICT:
  $handled= true;
  $errmsg= 'E_STRICT information: ' . $errstr;
  $this->modx->log(modX::LOG_LEVEL_INFO, $errmsg, '','',$errfile,$errline);
  return $handled;
  break;

Reference

PHP Manual - errorfunc.constants.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue in the code or project, which should be addressed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions