preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0

Created on 9 December 2020, over 4 years ago
Updated 22 May 2025, 2 months ago

Problem/Motivation

PHPCS reports the following deprecation error in sentence-case.inc:

13 | ERROR | preg_replace() - /e modifier is deprecated since PHP 5.5 and removed since PHP 7.0

Steps to reproduce

Sentence Case modifier probably doesn't work in PHP 7.0 and greater.

Proposed resolution

Use preg_replace_callback with an anonymous function, which is supported in PHP 5.3 and above.

🐛 Bug report
Status

Closed: outdated

Version

1.1

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024