Take the State of PHP 2026 Survey →

Deprecate backtick operator View as Markdown

Inactive
Authors
WesNetmo
Date
2018-02-11
Version
42.0.0-epsilon
Source
wiki.php.net/rfc/deprecate-backtick-operator

Discussions on the mailing list

RFC text

Copied from wiki.php.net, last synchronized Oct 13, 2026 11:53 UTC

Introduction

The backtick operator (`dir D:\foo`) is used to execute commands via shell.

The same functionality is also available as shell_exec().

Proposal

This RFC proposes to deprecate (by triggering one among E_DEPRECATED, E_STRICT or E_NOTICE) it in PHP 7.3 and suggest to use shell_exec() instead:

  • in case PHP decided in future to use backtick enclosed strings for Unicode strings
  • because it is a shady way to execute a rare and dangerous operation
  • because it is weirdly specific to a rare operation; regexp literals, xml-strings literals are way more common use cases, but they don't have a specific string literal

Backward Incompatible Changes

None, the feature will continue to work until it is removed in future PHP versions, but a notice will be emitted.

Proposed PHP Version:

7.3

Voting

2/3 majority will be required.

References

- Discussion on externals