Skip to main content

Glossary D

Glossary · E-commerce

Deprecation

Area
E-commerce

A deprecation is an announcement that a feature will be removed in a future version of a piece of software; until then, the feature can still be used.

PHP reports deprecated code through E_DEPRECATED notices. The PHP manual describes them as run-time notices which, if enabled, warn about code that will not work in future versions. Since PHP 8.4, developers can also mark their own functions as deprecated with the #[\Deprecated] attribute. Calling such a function then raises the corresponding notice, E_USER_DEPRECATED.

Among the features PHP 8.4 deprecates are implicitly nullable parameter types. Parameters are the named inputs of a function. If a parameter has null as its default value, it silently accepts null, even where its declared type does not allow null.

The Semantic Versioning FAQ says that before functionality is removed in a new major release (one that raises the first part of the version number), at least one minor release (one that raises the second) should contain the deprecation. Users can then move smoothly to the new API.

In a running Shopware 5 shop, deprecation notices are harmless at first, because they are not errors. If a plugin treats every such notice as an error, however, a single one of them can abort execution. Ahead of a PHP upgrade, we therefore go through the deprecation notices in the shop's error log to see where changes are needed.

Sources

  1. PHP-Handbuch: Fehlerbehandlung, Vordefinierte Konstanten (opens in a new tab)

    The PHP Group (php.net) accessed

  2. Semantic Versioning 2.0.0, deutsche Fassung (opens in a new tab)

    Semantic Versioning (semver.org) accessed

  3. PHP Manual: The Deprecated attribute (opens in a new tab)

    The PHP Group (php.net) accessed

Share on LinkedIn

Let's talk about your project.

If this term is on your desk right now, a conversation usually helps faster than any definition.

Search the website

Popular topics

All results