Using “_” as %s is deprecated since 8.4

Description

_ (underscore) is a valid class name, although it has become a reserved PHP word in PHP 8.4. In the future, it may be used for pattern matching, and by anticipation, it is not allowed for other usage that may ultimately conflict with it.

This applies to classes, traits, interfaces and enumerations. There is already an extension function called _, which is an alias of gettext, from the eponymous extension.

This applies in every name spaces.

Example

<?php

class _ {}

?>

Solutions

  • Use another name.